I'd like to give a different point of view than the one provided in Qmechanic's answer.
The reason is not because of gauge invariance. Indeed, gauge invariance is just a statement of redundancy and it can't possibly have any physical consequences.
My answer is instead the following: the photon is massless because it has just 2 degrees of freedom while being of spin-1. This is a statement completely independent of perturbation theory, Feynman diagrams and, in fact, even QFT. It would hold in any relativistic quantum theory such as string theory.
If doing perturbation theory one would be able to change the number of degrees of freedom it would signal an inconsistency of the theory (such as a violation of gauge invariance) or that the point we are perturbing around isn't a good approximation of what we want to describe (a massive photon involves extra degrees of freedom, i.e. the stuckelberg field aka the goldstone boson eaten in the Higgs mechanism which should have included for the start).
Phrasing it slightly differently, I am saying that is somewhat more transparent/physical defining a theory by specifying its physical degrees of freedom and their quantum numbers, than rather giving a local lagrangian and its redundancy (gauge invariance) to remove the extra stuff that isn't physical (such as the longitudinal extra mode associated with a would be photon mass).
Added in response to some comments
I think it's best if I add few clarifying remarks about gauge invariance that may notoriously confuse people.
Gauge invariance is nothing but a statement of equivalence of two theories. Theories A and B which are related by a gauge transformation are physically equivalent. If gauge invariance is broken perturbatively it means the two theories aren't really equivalent. For example, imagine you generate a mass term as the OP is imagining: the two theories with and without the mass term are physically distinct since e.g. now the electromagnetic interactions are either long or short range. In fact, one can always restore gauge invariance but at the prize of adding new degrees of freedom which indeed make the two theories distinct. For example, a theory with a photon mass $m^2 A_\mu^2$ can be made gauge invariance by adding an extra degree of freedom $\phi$, and then making $\phi$ physically irrelevant again by coupling it in a gauge invariance way, $m^2 A_\mu^2\rightarrow m^2(A_\mu-\partial_\mu\phi/v)^2$. Now, the theory contains in principle 3+1 degrees of freedom ($3$ from $A_\mu$ and $1$ from the $\phi$) but actually only $3$ are physical because of gauge invariance $A_\mu\rightarrow A_\mu+\partial_\mu\Lambda$, $\phi\rightarrow \phi+v\Lambda$ (for example one can fix the gauge by picking $\Lambda=-\phi/v$). The surviving 3 d.o.f are just the original d.o.f of a massive spin-1 particle.
All in all, if you want to describe a theory with two d.o.f. such a for a massless spin-1 particle with a local lorentz covariant vector $A_\mu$, you need gauge invariance to remove the extra longitudinal d.o.f., to make them physycically equivalent. The implication is $m^2=0 \mbox{ (or spin-1 with d.o.f=2)}\Rightarrow \mbox{gauge invariance}$, and not the other way around, since I can always construct a gauge invariant theory with a mass term (i.e. for a 3 physical d.o.f for a spin-1 particle) as done above: $\mbox{gauge invariance}\nRightarrow m=0$ (that is spin-1 with 2 d.o.f.). If by doing perturbation theory you were to generating a mass term to the photon it means that the perturbed theory and the original theory are nothing alike, and you can't use $A_\mu$ to describe in a mathematically consistent way just two d.o.f. any longer.