According to Mrs. Clean Housecleaning and Maid Service, musty smells on clean laundry are often caused by mildew growth inside the washing machine. Musty or mildew odors can also occur when clean clothing absorbs odors from mildew that has developed in the laundry room, or if wet clothing is accidentally left in the washing machine for an extended period of time.
Musty smells emanating from the washing machine can be eliminated by pouring 1 cup of bleach or dishwasher detergent into the machine and running an empty hot-water cycle. Musty odors can be removed from clothing by washing the affected items with the hottest water temperature allowed on the care label and air-drying the garments outside. Adding a cup of liquid fabric softener to a warm-water wash and allowing the garments to soak overnight is also a helpful odor removal technique.
In addition to hot-water washes and fabric softener, damp smells can be treated by machine washing the clothing with 1 cup of vinegar and 1 cup of baking soda, as both products contain ingredients that neutralize odors. Washing laundry in hot water and adding 1 cup of ammonia to the rinse cycle can help to remove odors as well, but it's important not to mix ammonia with bleach or detergents that contain bleach, as this can create a poisonous gas that can cause serious breathing difficulties.