The argument, which I reproduce here from Ramond's `Journies BSM', is originally by Witten and Vafa in ($\it{Phys}$. $\it{Rev}$. $\it{Lett}$. 53, 535(1984)). The argument is that for $\theta = 0 $ (mod $2\pi$) the QCD vacuum energy $E(\theta)$ is minimized. Starting from the Euclidean path integral for QCD ( with just massive fermions charged under QCD, nothing else) in a volume V
$ e^{- V E (\theta)} = \int \mathcal{D}A \mathcal{D} q \mathcal{D} \bar{q} exp \left( - \int d^4 x \mathcal{L}\right) $
where
$\mathcal{L} = - \frac{1}{4 g^2} Tr (G_{\mu \nu}G_{\mu \nu}) + \bar{q}_i (\gamma^\mu D_\mu+ m_i) q_i + \frac{i \theta}{32 \pi^2} Tr(G_{\mu \nu} \tilde{G}_{\mu \nu} ). $
Integrating out the quarks we obtain:
$ e^{- V E (\theta)} = \int \mathcal{D}A \det{(\gamma^\mu D_\mu+ m_i)} \mathcal{D} q \mathcal{D} \bar{q} exp \int d^4 x\left( \frac{1}{4 g^2} Tr (G_{\mu \nu}G_{\mu \nu}) - \frac{i \theta}{32 \pi^2} Tr(G_{\mu \nu} \tilde{G}_{\mu \nu} )\right). $
In pure QCD the quarks have vector-like couplings and so $\det{ (\gamma^\mu \mathcal{D}_\mu+ m_i) }$ is positive and real. For each eigenvalue $\lambda$ of $\gamma^\mu \mathcal{D}_\mu$ there is another of opposite sign. Thus
$\det{ (\gamma^\mu D_\mu+ m_i) } = \prod_\lambda (i \lambda +M) = \prod_{\lambda>0} (i \lambda +M)(-i \lambda +M) = \prod_{\lambda>0} ( \lambda^2 +M^2 )^2 >0 $
Thus if $\theta$ were zero, the integrand would be made up of purely real and positive quantities. Now, the inclusion of the $\theta$ term with its i can only reduce the value of the path integral, which is the same as increasing the value of $E(\theta)$. It follows that $E(\theta)$ is minimized at $\theta = 0$. This is the motivation for axions where $\theta$ is promoted to a dynamical field which then relaxes to a vev of 0.
Ramond adds there is `the slight caveat' that with Yukawa couplings, the fermion determinant may not longer be positive nor real. Witten and Vafa don't seem to make any similar caveat. Ramond's note about yukawas seems to invalidate the whole argument. Where does this leave axions as a candidate to solve the Strong CP problem?