Cause
Mold can grow on the condenser coil of your air conditioning unit. This occurs when the air conditioner does not drain properly and moisture collects inside of it. The mold releases spores that are blown through your home's air ducts and out the air vents, bringing a musty smell with them, according to the book "When Technology Fails" by Matthew Stein.
Solution
Removing the mold will stop the smell from coming through your home's central air vents. Using a solution of 1/2 cup of bleach to 1 gallon of water, wash the condenser coil and pan of your air conditioning unit. This will remove the mold and disinfect the unit.
Prevention
You can prevent the mold from returning by making sure your air conditioning unit drains properly. Having the unit serviced regularly can reduce your risk of mold building up inside of it, as well as the danger of mold growing inside the air ducts of your home, according to the book "Recognition, Evaluation, and Control of Indoor Mold" by Bradley Prezant, Donald M. Weekes and J. David Miller.