If the photon had mass, it cannot travel at the speed of light as it would require infinite energy according to the equations of relativity.
Since photons travel at the speed of light, they have to have no mass and all their energy comes from their momentum.
This feels incorrect to anyone only familiar with classical physics because classically momentum is mass times velocity (speed with a direction). But with relativity, you have to consider momentum as a fundamental concept independent of mass.
Why would they have mass?
Theories where all particles are massless are much easier. So historically the question was the opposite: How can particles have mass? That question was especially tricky for particles that are responsible for interactions. In the 1960s, a couple of theorists found a way to give some of these particles mass: The Higgs mechanism. They predicted that there should be a new particle, too, the Higgs boson. If it exists (it was discovered in 2012) it would allow the W and Z bosons to have mass, but you still cannot give a mass to all particles. The photon has to stay massless.
Some particles (quarks and leptons) have mass because they interact with the Higgs field, they make up all physical things. Some particles (bosons) have no mass because they don’t interact with the Higgs field. They are called “force carriers” because they exert forces on matter particles. Photons (which are bosons) exert forces on electrons (which are leptons.)
The deep reason for why and how photons have no mass is something that Physicists have been trying to figure out since Einstein. Truely understanding photons would revolutionize modern science. What we do know is; to make all the physics equations that we have work right, we have to assume photons have zero mass.
For an interesting read about what happens when things with mass get close to the speed of light I suggest : [Relativistic Baseball (xkcd.com)](https://what-if.xkcd.com/1/)
Photons “don’t have mass” because that’s how our math and understanding of science and light speed particles was written and is understood.
However as with any science, this could be proven wrong in the future, and in reality photons do “have mass” in that they are an actual physical thing in our universe but they are just so blasted small and move so stinking fast that we (to our understanding) can’t “weigh” a single photon to figure out how little something has to weigh/how little of mass is required to be able to travel and light speed.
In classical mechanics, mass is the relation between a force and the acceleration it creates. If I push you and you back off 2 steps, then your mass is whatever value makes this relation true.
In relativity mass changes a bit, because you consider that mass is not just some number, but it is a form of energy. The famous equation from Einstein shows that: E=mc^(2) just means that the mass m is stored energy that depends on the speed (if you remember classical mechanics, think a bit of the potential energy of gravity, where the energy is “saved” in the body when it is in height and it is “freed” when it falls). Obviously this equation in reality is much more complex because energy doesn’t only come from mass but from movement as well (like the classical kinetic energy).
If you have that the amount of energy is fixed, then the only things you can change in the equation are the speed and the mass. Basically we say that light has no mass because it is the only way to balance the equation that will manage to give you that the speed is actually the speed of light.
You have to take this explanations with a grain of salt, since they are wrong for the sake of clarity. No matter how simple you make it, it will never be ELI5. Others here have explained the real stuff, but it is way out of the scope of the sub. For fuck’s sake, when would you ever tell a 5yo about the Higgs field.
Latest Answers