A photon has helicity, not spin. As I said, massless particles are special. One says a photon as "spin 1". This labels the representation of the rotation group for the field, i.e., ##J=1##. In other words you have a vector field. However, since the photon is massless, it has not ##2J+1=3## independent but only 2 (e.g., helicity ##h=\pm 1##, corresponding to right- and left-circularly polarized em. fields).
This indicates another complication. Since you want not only a theory that is rotation invariant but a local Poincare invariant theory, you need at least a four-vector field, ##A^{\mu}(x)## to describe the electromagnetic field, i.e., four field degrees of freedom. One degree of freedom is due to the fact that a four-vector field doesn't describe only spin-1 fields but also a scalar field (under rotations). You can build various scalars under rotations. A particularly convenient one is ##\partial_{\mu} A^{\mu}##, and you can impose a constraint ##\partial_{\mu} A^{\mu}=0##. For a massive field that would be all you have to do to get the 3 physical field degrees of freedom for a spin-1 field. However massless fields are special, and the representation theory of the Poincare group tells you that necessarily the massless spin-1 field must be represented by a gauge field. That means that a physical situation is described not only by one vector field but any vector field ##A^{\prime \mu}=A^{\mu}+\partial^{\mu} \chi## with an arbitrary scalar field ##\chi## describes exactly the same situation. This means in addition to the constraint to have only vector fields but no scalar field component you can impose another constraint. This can be achieved by "fixing the gauge completely". In order to fulfill the above Lorentz invariant constraint for both ##A^{\mu}## and ##A^{\prime \mu}## you can choose any ##\chi## fulfilling ##\partial_{\mu} \partial^{\mu} \chi=\Box \chi=0##. For the free em. field a clever choice is to impose the additional constraint that ##A^0=0## (radiation gauge). Then you have
$$A^0=0, \quad \vec{\nabla} \cdot \vec{A}=0,$$
and thus you have only 2 independent field-degrees of freedom. A field with "good momentum" is a plane wave, and the corresponding field mode is $$\vec{A}=\vec{A}_0 \exp(-\mathrm{i} \omega t+\mathrm{i} \vec{k} \cdot \vec{x})$$. The radiation-gauge constraint then simplifies to ##\vec{k} \cdot \vec{A}_0=0##, which tells you that there are only 2 independent modes left, namely the ones perpendicular to the momentum ##\vec{k}##. As it should be the free em. field is a transverse wave.