How can spin be gauge dependent? Deriving the spin (density) of an electromagnetic wave, I obtained
the formula
$$\mathbf S = \mathbf E \times \mathbf A$$
But under a gauge transformation $\mathbf A+\nabla f$ this function seems to change. Does this mean classical spin is not observable? Should a particular gauge be imposed?
 A: The expression for the spin density is almost correct, but it only involves the rotational part $A_\text{rot}$ of the vector potential $A$, which can be Helmholtz decomposed into
$$ \vec A = \vec A_\text{grad} + \vec A_\text{rot}$$
where $\vec A_\text{grad}$ is a gradient (hence curl-free) while $\vec A_\text{rot}$ is a curl. Since a gauge transformation is adding the gradient of a scalar function to the vector potential, the rotational part of the vector potential is gauge invariant.
If you now calculate the total angular momentum $\vec L = \frac{1}{4\pi c}\int \vec r \times \vec S\mathrm{d}V$ of the electromagnetic wave with Poynting vector $\vec S = \vec E \times \vec B$, it decomposes into three parts:
$$ \vec L =  \vec L_\text{can} + \vec L_\text{spin} + \vec L_\text{orbital}$$
where 
\begin{align}
\vec L_\text{can} & = \frac{1}{4\pi c}\int \vec r \times (\vec E_\text{grad} \times \vec B) \mathrm{d}V\\
\vec L_\text{spin} & = \frac{1}{4\pi c}\int \vec E_\text{rot} \times \vec A_\text{rot}\mathrm{d}V\\
\vec L_\text{orbital} & = \frac{1}{4\pi c}\int \vec r \times \left(\sum_{i=1}^3E_{\text{rot},i}\vec \nabla A_{\text{rot},i}\right)\mathrm{d}V
\end{align}
and we identify the classical "spin" part by it not depending on the choice of origin for $\vec r$, and hence being an intrinsic property of the wave. Since the spin part depends only on the rotational part of the vector potential, it is gauge invariant.
The reason you haven't derived this is most likely that you applied some of the usual vector identities to the starting density $\vec r \times (\vec E \times \vec B)$, where $\vec B = \vec \nabla \times \vec A$ without realizing that it is indeed $B = \vec \nabla \times \vec A_\text{rot}$ since the curl of gradients is zero.
