Why does cheese have an expiry date?
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)