Mold grows on cheese because there is a lot of nutrition there for it to grow. There is a trick to keeping the mold off the cheese, and this is to prevent the cheese from being exposed to air. In some cases this is done by painting the cheese with wax. In some cases, it is done by soaking the cheese with salty water, which dries out the rind of the cheese, making it less attractive for mold to grow. An alternative used by cheese makers is to scrape the mold off from time to time.
Moldy cheese comes in two types. Some have mold that grows over the surface, usually a white mold such as what appears on brie. Some have blue or green mold that grows in the interior. This is done by running thick needles through it so oxygen can get into the interior. In either case, the cheese has to be exposed to the proper mold.
Some people think that cheese is moldy milk, but it is not. Most cheese has no mold. Most cheese is made from My Local Cause
milk through the action of bacteria, but not all. Mold and bacteria are not the same thing. Some of these have mold on them, but the ones that do mostly have either white penicillium mold (as on brie) or blue or green penicillium mold (as on blue cheese).
Some cheese is not even fermented; examples are queso blanko and gjetost, which are made with heat and acid, and a variety of cheeses are prepared with rennet, but without bacteria.