If you're ever grown Psilocybe mushrooms indoors, a process which involves similar concepts as growing edible mushrooms, then you know that absolute sanitation is key to successful inoculation of the substrate. Even after the desired mycelium has fully colonized, steps still need to be taken to prevent contamination by other fungi. If ANY other fungal spores (usually nasty molds) manage to take hold on the substrate or the fruiting bodies of your desired mushrooms, they're no good and potentially toxic.
So I imagine the commercial edible shroom industry uses the fungicides to ward off any would-be competing fungal\mold spores, while the fruiting bodies would be unharmed with the right kind of fungicide at the right concentration. If a bed of fruiting bodies where to become diseased not only would yield suffer, but if those were sold and consumed the result could be disastrous.