Spin is always derived from the tensor rank of the field, as ajb says. If it's a scalar field (rank 0), the spin is zero. If it's a spinor (electrons) then the spin is 1/2; I guess a spinor is kind of a 1/2-rank tensor. Electromagnetic fields are vectors (1st rank tensors) so the spin is 1.
The derivation comes from the field Lagrangian being a scalar. There is a good rundown of the derivation in Mandl & Shaw "Quantum Field Theory", Chapter 2 I think.
...although the gravity field is the metric tensor (not the stress - energy tensor; the latter is the _source_ of the field, not the field itself). But anyway, the metric tensor is 2nd rank, so - Spin =2.