Why is water running into my water heater when cold water inlet is turned off?
This is because after turning off your water you still have water in the pipes.   The water heater in most houses is at one of the lowest points in the house.   Meaning that even after turning off water at tap and even after leaving a faucet open, whatever is lowest will still get what water is left in the lines.

It is funny because my new helpers go through this exact experience when prepping for plumbing work.   And they are each surprised about the amount of water that is still left in the pipes (and more surprised that they have to clean it up).   

What you are experiencing is normal and if the water heater is the lowest (gravity) or one of the lowest spots in your water line it is perfectly normal to hear water flow after it is turned off and then dribble for a while - takes 5-10 mins for gravity to works its way out sometimes.