The answer to 'why is my water heater foul smell' is that a rotten egg or sulfur-like odor coming from your water heater is typically caused by a buildup of bacteria in the tank. This bacteria can produce hydrogen sulfide gas, which creates the unpleasant smell. Common causes include a magnesium anode rod that needs to be replaced, sediment buildup in the tank, or an issue with the water supply.
The good news is that this is a common problem with several potential solutions, some of which you may be able to handle yourself. However, if the smell persists or you're unsure of the cause, it's best to have a professional plumber take a look to properly diagnose and fix the issue.