Drains, water heaters, wells, and the inside of pipes can harbor bacteria. Usually, your water heater is the culprit when water smells of rotten eggs. The heater contains an element that protects it against corrosion, but this element can give off a rotten egg smell as it breaks down over time.