In section 6.2 (page 128) of David Tong's Lectures on QFT, Gauss' law is derived for the free Maxwell theory. The result of computing the Hamiltonian of the theory is (eq. 6.17),
$$H = \int d^{3} x \frac{1}{2} \vec{E} \cdot \vec{E}+\frac{1}{2} \vec{B} \cdot \vec{B}-A_{0}(\nabla \cdot \vec{E}).\tag{6.17}$$
I am comfortable reproducing this computation, but I do not understand what is meant by the claim:
"So $A_0$ acts as a Lagrange multiplier which imposes Gauss' law".
Earlier in eq. (6.10), it is established that $A_0$ is not an independent physical degree of freedom, and I'm assuming this fact is somehow operative in the Gauss's law statement. It's not clear to me though.