I dont know if this a “scientific” or “philosophical” question. I suppose it could be both.

Does mildew exist to serve any “useful” purpose?

I couldn’t find any purpose they serve, but they are a member of a classification that has been around for a billion and 1/2 years, so whatever they do they’ve been doing it (or not doing it) for a long time. A guess is that they help in the decomposing process.

Like most fungi, mildew speeds decomposition. That’s useful, but like some other fungi, mildew sometimes ends up eating stuff you don’t want to lose. Live plants, for example, or the soap scum in your shower.