Earthy smell from hot water
Smells from bacteria tend to be "foul", the kind of odor that makes your stomach queasy.  Heavy concentrations of the minerals and sediment normally found in water can have an "earthy" smell, and these can collect in your hot water tank.  

Your hot water tank should have a spigot near the bottom.  It's there for periodically purging the minerals and sediment that collect at the bottom.  Stick a basin under the spigot and open the valve.  What comes out into the basin will likely contain a lot of particles that look like sand.  You usually don't have to let it run for long, the sediment will wash out quickly.  It's a good idea to do this periodically (maybe once a year or so).