  We compute the two-loop corrections to the helicity amplitudes for the
coupling of a massive vector boson to a massless quark-antiquark pair and a
gluon, accounting for vector and axial-vector couplings of the vector boson and
distinguishing isospin non-singlet and singlet contributions. A new
four-dimensional basis for the decomposition of the amplitudes into 12
invariant tensor structures is introduced. The associated form factors are then
computed up to two loops in QCD using dimensional regularization. After
performing renormalization and infrared subtraction, the finite parts of the
renormalized non-singlet vector and axial-vector form factors are shown agree
with each other, and to reproduce the previously known two-loop amplitudes. The
singlet axial-vector amplitude receives a contribution from the axial anomaly
from two loops onwards. This amplitude is computed for massless and massive
internal quarks. Our results provide the last missing two-loop amplitudes
entering the NNLO QCD corrections of vector-boson-plus-jet production at hadron
colliders.
