That's an excellent question! And there are two answers.
1. If you apply the principle of relativity to Maxwell's equations, that's the result you get. Maxwell's equations predict a wave phenomenon that propagates at a constant speed in a vacuum. If the laws of physics, including the laws of electromagnetism, are the same for all inertial observers, then the speed at which those waves propagate have to be the Lorentz-invariant speed.
2. Experiments bear out this prediction! :-)
Note that it did not have to be this way, but if it were not, then EM experiments would give different results for observers in different inertial frames, which would falsify the relativity assumption. The different results for EM experiments would allow you to identify a privileged inertial frame. For a long time, physicists thought this would turn out to be the case, that there was a medium, a "luminiferous aether", through which EM waves propagated, and this medium would define a privileged frame (at least for electromagnetism). It just turns out by experiment that this is wrong, at least in our universe.