The brood in an ant colony are most vulnerable to parasites because their individual defenses are limited, and the nest material in which ants live is also likely to be prone to colonization by potential parasites. Here, we investigate in two ant species whether adult workers use their antimicrobial secretions not only to protect each other but also to sanitize the vulnerable brood and nest material. We find that, in both leaf-cutting ants and weaver ants, the survival of the brood was reduced and the sporulation of parasitic fungi from them increased, when the workers nursing them lacked functional antimicrobial-producing glands. This was the case for both larvae that were experimentally treated with a fungal parasite (Metarhizium) and control larvae which developed infections of an opportunistic fungal parasite (Aspergillus). Similarly, fungi were more likely to grow on the nest material of both ant species if the glands of attending workers were blocked. The results show that the defense of brood and sanitization of nest material are important functions of the antimicrobial secretions of adult ants and that ubiquitous, opportunistic fungi may be a more important driver of the evolution of these defenses than rarer, specialist parasites.