The property of the photon moving with speed of light can be derived through the relationship between the Lagrangian and the Hamiltonian of a free particle (with mass or without mass):
$$ H = p\cdot \dot{q} -\cal{L} \equiv p\cdot v -\cal{L}$$
where $v$ is the velocity as time derivative of the canonical coordinate $q$ of the free particle. $p$ is the momentum of the free particle.
Now in relativistic mechanics the Lagrangian of the free particle is
$$\cal{L} = const \int ds $$
the constant term const is only necessary to keep up with the units and $ds$ is the invariant line element:
$$ds = \sqrt{c^2dt^2 -dx^2 -dy^2 -dz^2}$$
So for photons the line element ds vanishes: $ds=0$, so the Lagrangian is zero. So the Hamiltonian is simply:
$$H = p\cdot v$$
Furthermore we know from relativistic mechanics that the energy of a free particle is :
$$ E =\sqrt{ (pc)^2 + m^2 c^4}$$
For a massless photon m=0 we get:
$$E =p\cdot c$$
Knowing that the Hamiltonian of a particle corresponds to its energy we get:
$$p\cdot v = H \equiv E = pc$$
which finally provides us with the answer: $v =c$.
The main reason why photons move with speed of light is that they are massless $m=0$.
But one could also just "define" photons as free particles (possibly adding another property to distinguish them from other massless particles -- gravitons for instance) whose line element is zero --- since this property is essential for the proof.