"Spin" is dictated by the representation of the Loretz group the field the particle is a quantum of transforms in. Half-integer spins are fermions, integer spins are bosons by the spin-statistics theorem, where representations of the Lorentz group are labeled by two numbers $(s_1,s_2)$, whose sum is what we call spin in this context. The significance of the sum is that only representations with integer $s_1+s_2$ are proper linear representations, while the half-integer ones are only projective representations.
Since the electromagnetic four-potential is a four-vector, it transforms in the four-vector representation $(\frac{1}{2},\frac{1}{2})$-representation, which has integer spin, and hence photons are bosons. It is really just the kind of field we are quantizing - scalar, vector, spinor - that dictates the spin, and it is not true that we "only find out later" that photons have spin 1 (although some texts may make it seem like that), we know that from the start.