The answer to 'why is my water heater smells bad' is that a rotten egg or sulfur-like odor coming from your water heater is usually caused by bacteria in the tank that produce hydrogen sulfide gas. This is a common issue, especially in areas with high sulfur content in the water.
Other potential causes include a malfunctioning anode rod, mineral buildup, or a problem with the water supply. If the smell is coming from the hot water, it's likely originating in the water heater itself.