Question: Why can't photons have a mass? Could you explain this to me in a short and mathematical way?

Answer: 
I think the central issue is the invariant interval and invariant mass. A particle moving in spacetime has the interval $ds^2~=~dt^2~-~dx^idx\_i$. There is the corresponding invariant mass $m^2~=~E^2~-~p^2$, which is the momentum spacetime interval. So let us consider the plane wave $\psi~=~exp(-i{\vec k}\cdot{\vec x}~+~i\omega t)$ $=~exp(-ik^\mu x\_\mu)$. The Laplacian operator $\Delta~=~\nabla^2~-~\partial^2/\partial t^2$ applied to $\psi$ is
$$
(\nabla^2~-~\partial/\partial t)~=~(\omega^2~-~k^2)\psi~=~\hbar^{-2}(E^2~-~p^2)\psi.
$$
This is an eigenvalued problem with $\Delta\psi~=~\lambda\psi$. If the particle has mass this eigenvalue is the mass squared. This means there is dispersion as $|k|~=~\sqrt{\omega^2~-~m^2} $ and for $\omega~=~2\pi/\lambda$ we then have that
$$
|k|~=~c\sqrt{2\pi/\lambda^2~-~m^2}
$$
The velocity of a wave is then only exactly $c~=~1$, or $|k|~=~2\pi/\lambda$, with of course $kc~=~\omega$, for $m~=~0$, and otherwise we contradict our assumption of the wave existing on a null interval $ds^2~=~0$. If the invariant interval in the spacetime is zero, then the corresponding invariant mass in the momentum-spacetime must be zero.

The above Laplacian in the case of a photon is predicted as the wave equation operator by Maxwell's equations.
put simply - mass terms for photons break gauge invariance.