Perhaps the biggest culprit for a smelly floor is the water source used to clean it. Well water, though fresh enough to use and consume, can sometimes have an unpleasant "rotten egg" odor. This is usually caused by sulfur contaminants. Throughout the floor-cleaning process, change the water with fresh hot water and detergent to stop the spread of dirt and bacteria throughout the space, which could be contributing to the odor. A few drops of bleach added to the mop water for wood or tile floors can help kill bacteria and mildew to freshen the scent.
For tile, laminate and hardwood floors, a strong mop is a necessity in floor washing. However, if the mop is dirty and smelly, this could be contributing to the foul odor still present after you wash it. Before cleaning your floors, soak the mop in hot water, bleach and soap to clean, or attach a new mop head. If you are washing carpets, soak the brushes of your steam or vacuum cleaner attachment with a vinegar and water solution to prepare for cleaning your floors again.
If the smell of your floor persists, you need to locate the source. For example, carpets are more prone to trap odors than hard floors. This is especially true with dirt, food pieces and pet mess. Minimize the proximity of these items to your flooring by eating over place mats and regularly vacuuming crumbs. Wash your pet regularly or provide area rugs to keep them from sitting directly on the floor. Spot-treat any visible stains, such as from pet waste, with vinegar and baking soda to remove the odor and lighten the appearance of the stain.
Check to see if the smell is actually coming from your floors. If sprinkling baking soda over the surface, leaving over night and sweeping and vacuuming doesn't do the trick, you should at least try to mask the odor. Air fresheners work to completely cover smells in a room. Spray the freshener into the air and it will disperse to freshen the flooring as well. If the smell is concentrated in one single area, place a bowl of liquid all-purpose cleaner in the area and let it sit overnight to mask some of the scent.