A good way to remove musty smells or musty odors from old clothes is to fill the washing machine up with water and then add a cup or two cups of vinegar and a cup of baking soda into the washing machine and then turn the washing machine on for at least a few minutes to allow the water, baking soda and vinegar to mix together.
Then let the clothes sit in the washing machine for a few hours or overnight to get the musty smell out of the clothes.
Then run the washing machine through it's normal wash cycle and then musty smell should be gone as it's worked great for me.
If the musty smell is still in the clothes then you may need to use some oxygen bleach or borax or some enzyme odor remover.
Sometimes it might take a few wash cycles to get the musty smell completely out of the old clothes and I would also recommend hanging the clothes out to dry in the fresh air to help with the odors.