Why 74hc595 keep my light always on
The problem here seems to be that you're assuming that the outputs of the 74HC595 will all be low upon power-up.

This is not a valid assumption. The datasheet makes no guarantee about the state of the outputs upon power-up. They could be high, they could be low, they could vary from part to part, they even could be a mixture of high and low on different pins.

Basically, the only way to ensure that the 595's output pins are in a known state when you power it up is to have a circuit that triggers the MR input when the system is powered, and continues triggering the MR pin until the 5V power is stable.



As an aside, I actually was recently working on a project where I needed some additional outputs, and I specifically didn't use a 75HC595 for exactly this reason - you cannot guarantee it's power-on state.