I believe it's one of those camping mysteries and I've not read of way to stop it. When ours starts to get a bit of a mildew smell we do the cleaning routine in the dometic manual.
1/4 cup dish soap, 1/4 cup bleach, 5 gallons warm water splashed all over the top, roll it up for 5 minutes, unroll and rinse. By rolling it up you get both sides coated. Sometimes it requires two doses.
2015 Jay Flight 31 RLDS
2015 F250, Reese straightline
Ham Lic: W4TFB