Towels may have a moldy or mildew smell even after washing if they have still contain bacteria. If the bacteria aren't killed by soap and hot water, they continue to breed, producing the unpleasant odor.
Towels retain bacteria and produce moldy smells when they are left damp for too long. One of the best preventative measures is to hang towels on racks and let them dry thoroughly. If towels continue to smell after a washing, the washing machine itself may be infected with bacteria and must be sanitized. Washing just a few towels on the hottest water setting with a detergent booster may help eliminate the moldy smell.