There are several factors as to why an engine would not run the “ideal” stoichiometric ratio of fuels. Here are the two main reasons why rocket engines wouldn’t run the “ideal” ratio.
Higher exhaust velocity
An equation defining exhaust velocity in Richard Nakkas website shows that molecular mass of the exhaust products ends up on the denominator of the equation. This means that the lighter the exhaust product is, the faster the exhaust velocity. So it may be beneficial to run the engine not stoichiometrically ideal in order to keep the molecular mass the least. This is why most hydrolox engines run fuel rich as hydrogen is much lighter than oxygen, making for a more efficient engine as combustion products contain much more hydrogen.
Lower combustion temperature
While that same equation defined in the above paragraph shows that a higher temperature improves the efficiency, too high of a temperature can lead to the engine becoming damaged and the process of rapid disassembly will occur. This is why some engines are run rich in either fuel of oxidizer to ensure that the combustion temperature is certainly something that the chamber and nozzle can handle.