When you replaced the stem, you didn't touch the switch at all, correct?
Another possibility (and most likely) is that the power goes to the light first, then onto the switch. When you hooked up the wires at the light, you bypassed the wires going to the switch.
Black and Decker puts out an excellent book on electricity. I suggest you purchase it and study the wiring diagrams.
© 2017 Renovate Your World LLC