In my case, I concluded that decaying liquid fabric softener residue was actually the cause of the musty odor of even freshly washed laundry.
After much reading up on the topic, I tried substituting white vinegar for fabric softener in the washing machine and I haven’t had a problem since. The vinegar washes out completely if not over done, so things don’t end up smelling like cucumber salad.
I still use fabric softener paper in the drier cycle, though.