So according to QFT, fundamental particles are just excitations in their underlying fields. So the photon would correspond to an oscillation of the EM field. But it takes energy to excite this field. And E=mc^2. So therefore the photon should have some mass. Energy was put in to create it. That energy has to be concentrated somewhere.