First, your main shut off may be leaking by. Not uncommon.
Second, you can get siphoning of water from the water heater. It would have been better to leave all the taps closed, and close the shutoff at the water heater.
Remember that when changing a low valve, you have quite a bit of water in the pipes in the wall that has to drain out.