Dear student,
Because at speed of light it travels in the wave form.So if it is a wave there is no concept of mass applied.
And if it is, u should know that rest mass of photon is 0 so its mass would become 0/0 and not infinite.
Its a fact.
Thank you :)