Switches can fail internally, as Wheel mentioned. It's common with old switches in older houses. When they fail, they either arc internally, causing overheating, or they short and keep the circuit on (so the light can't be turned off at the switch). A couple of years ago I replaced a nearly 100–year-old wall switch that failed so that the overhead light stayed on.
Newer switches can fail too. This could have been one. Even if manufacturing is 99.99% good, that still leaves that 0.01% that will fail prematurely.
Newer switches can fail too. This could have been one. Even if manufacturing is 99.99% good, that still leaves that 0.01% that will fail prematurely.