There's no real symmetry argument that can explain why the $z$ component is zero. This is because it doesn't have to be: there can always be a uniform magnetic field added to the existing field, without affecting Maxwell's equations. They are all differential equations in the fields, like the following:
$$\nabla\times\mathbf{B} = 0$$
which is Ampere's (magnetostatic) law in vacuum. This is where boundary conditions play a role.
In my opinion, a slightly better argument is this: you can show that if there is a $z$-component, then it must be constant in space - there is no current through by any loop in a vertical ($z$-direction containing) plane. The solution you get is then the usual circulating magnetic field due to a wire plus a constant field, say $\mathbf{b}$:
$$\mathbf{B} = \frac{\mu_0 I}{2\pi r}\hat{\mathbf{e}}_\phi + \mathbf{b}$$
so that when $I = 0$, $\mathbf{B} = \mathbf{b}$.
Now, you have to enforce the following by hand: that when there is no current, you expect no magnetic field. You can also require the magnetic field to be zero infinitely far away from the wire ("boundary condition"). Either of this is possible only when $\mathbf{b} = 0$.
It is possible to have (at least theoretical) cases where $\mathbf{b} \ne 0$, such as when you have the wire inside an infinitely large solenoid (having an infinitely large product of turns per unit length and current). The principle of linear superposition then dictates that the contribution to the magnetic field from the wire would then add up to the existing uniform magnetic field. To deduce from the (still-existing) symmetry along the $z$ axis that there is no 'vertical' magnetic field would then be incorrect.