In your case an air gap device separates the heater from a drain of some sort. In you case I would imagine that your emergency overflow drain that is on the side of the hot water heater is connected directly somehow to a drain pipe in some manner. The pipe cannot be connected in such a manner that water can either back up via a siphoning effect, or allow contaminated water to get into the potable water in the house.
If you can take a few photos of your heater install, both the pipe area where the hot and cold connect to the heater, and the bottom of the heater where the discharge pipe is for the temp and pressure valve is discharging, we can provide a more descriptive answer to the question. But in any case the discharge pipe is most likely the issue at hand here.
The fix should be simple. But without knowing exactly how your heater was piped in any advice on how to correct would be simply a guess at best.