Cheese is not made from "rotten" milk, let me clarify that. Rotting is an uncontrolled process in which bacteria, molds and other life forms colonize milk, eat it, release waste into it and die. The resulting, rather unpredictable, crud we call rotten (or more precisely spoiled) milk.
Most cheese is the product of highly controlled action by bacteria that produce acids that coagulate the casein in the milk. The type of bacteria, the temperature, the amount of time they are allowed to act, the amount of water you drain out of the curdling milk, all control the end result in terms of texture, taste and flavor.
The kicker, though, is that cheese is by no means a sterile product - not even cheese made with pasteurized milk. Bacteria remain inside the cheese, and of course bacteria (and molds and yeasts) land on its surface through its processing and shelf time. While the action of these bacteria can be slowed down by cold and dryness, most cheeses will go bad after a while. How long is "a while"? It depends. At room temperature, mozzarella will go bad in a matter of hours while an aged unopened Parmesan may sit happily on a shelf for months and even years.
(apologies for the short and brutal definition of cheese: I have omitted curdling by other methods and the various surface treatments that can be applied to cheese crust)
This is a combination of the type of cheese and too much heat. Some cheeses melt more readily (mozzarella for example), but all of them will seize up if they are heated too much too fast - the proteins 'curl up' and separate from the fat and water in the cheese.
To combat this, you should chop or grate the cheese up to speed up melting, and lower the heat a little before adding it. You should also avoid using cheese straight from the fridge.
Best Answer
A lot of cheeses are naturally brined (feta, for example), and marinating cheese is not much different. For the best effect:
If the cheese is really wet (like feta), add weights to the drying process (like a pot or heavy plate), and let it drain until the surface feels dry.
Note that many cheeses are already salty, so balance your marinade with this in mind.