Perhaps they weren’t fully dry when you put them away. That can really stink them up.
Alternately, they weren’t completely clean. It could be that your washer left behind some residue. Try an extra rinse cycle with a cup of vinegar or lemon juice next time.
It could be that the closet itself has mildew in it. Try washing down the walls with a disinfectant, and then putting some cedar chips in there with the sheets. You may want to leave the door slightly ajar to encourage air circulation.
Properly cleaned fabric should not be able to evolve off odors without some sort of external influence (i.e., mold, mildew, residue, insects or vermin)