When I asked why did light follow the law of reflection, I was answered that it obeys the principle of least time. So my question is, why does it even obey the principle of least time?
Summarizing some of the comments as an answer:
There are some excellent reference in the comments such as
Feynman's lectures: http://www.feynmanlectures.caltech.edu/I_26.html#Ch26-S6
and Fermat's principle from Maxwell's equations: https://physics.stackexchange.com/a/151488/26076
and also how Snell's law follows from the principle of least time: https://physics.stackexchange.com/a/151488/26076
The question you are asking is quite wide as it allows for answers of the type 'A' follows from 'B'. However at some point we come the the point that 'B' follows from 'C' and 'C' is just the way that nature behaves.