If you've ever tried to grow mushrooms, the most frustrating part is inoculating the substrate with mushroom spores, without letting mold spores compete with them. The problem is that mold spores are everywhere. And exponential growth guarantees that whether the number of spores that get in your substrate is 1 or 10 or 100...they will eventually become visible and take over. The trick is to make sure that the mushroom mycelia outpace their growth and colonize the substrate faster. At some point, the mycelia will encounter mold (unless you have a BSL-4 lab in which to grow your shiitakes). If they are sufficiently established, they will engage in chemical/biological warfare and steamroll any competitors on their way to full colonization.
Now, while all organisms are sensitive to temperature, and while 4 C is an ideal temp for minimizing the growth rate of pathogens, anyone who has taken a mold-ridden jar out of the fridge knows that it is only buying time in an unwinnable war. Every time you take a bite of food, you are eating mold and/or its spores, but hopefully at a concentration that is too low to matter.
For this reason, I am not that convinced about front vs. back of fridge arguments. Unless you are opening your fridge 20+ times a day, or it has a particularly weak compressor, I would be surprised if temperature variation could account for more than a few days' growing time for the mold.
I am also skeptical about the opacity of the container. If your kitchen is open to direct sunlight (no windows) or you have sterilizing UV lights in your kitchen, then the container definitely matters. Otherwise, it is only blocking optical frequencies which make very little difference to the milk other than raw temperature (which should be dominated by the fridge). In fact, light is more likely to damage microbes in the milk rather than protect them (except for photosynthesizing microbes, and I would be very curious to know how they got in your milk). So I would actually expect a more opaque container to slightly favor spoilage than reduce it.
Therefore, I would suggest that the most likely explanation of variance is a combination of 1) initial pasteurization level, and 2) exposure rates. I somewhat doubt that 1) can explain a month of spoilage-free milk by itself because I suspect that many bottles of milk get "ultra-pasteurized" and yet do not last a month with "normal" usage. However, a weakly pasteurized bottle would likely not last a month even if you left it alone the whole time. So being decently well pasteurized is probably a necessary, but not sufficient condition for your anomaly.
I would propose that most spoilage conditions can be predicted on the basis of average mold load, and total exposure time. While mold spores are floating pretty much everywhere, all the time, the concentration can vary quite a bit from day to day and place to place. Obviously, a well-ventilated room with a HEPA filter will have a much lower spore load than a drafty kitchen with a loaf of molding bread sitting open in the garbage can. You can control the mold load somewhat by minimizing mold sources and filtering the air.
But the biggest variable you can control is the exposure time, or the amount of time that mold spores floating in the air can get into your food (or milk, in this case). This is obviously a function of how many times you open the lid, and for how long the lid remains off. Using the milk a few times for larger amounts will result in less exposure than using the milk often for small amounts. And leaving the lid off is simply inviting spores to colonize your giant vat of microbe food. What might have happened is that you simply didn't use the month-long milk very often, and when you did, you were exceptionally prompt at replacing the lid, minimizing open-air exposure. Note that just opening the lid to sniff it and see if it is still good also introduces spores. So the more often you check your milk, the faster it will spoil. Being in the back of the fridge may have eliminated any impulse to pull it and check it, minimizing the number of "mold spore inoculations".
Also, the shape of the container matters. It is quite fortuitous (and perhaps not at all accidental) that many milk bottles contain a relatively small opening. This reduces the surface area through which mold spores can land in your dairy treasure. The cardboard cartons with the rip-top openings, on the other hand, are a giant invitation to colonization, and should thus be consumed as quickly as practical.
Grow Some Shrooms!
I think everyone who handles food should grow mushrooms at least once in their life. It only takes a few batches of moldy frustrating failure to learn intuitively just how moldy our air is, and how aggressive microbes can be. It also brings home the importance of covering food. Most food safety guides talk about temperature and cooling food quickly. But again, low temperatures are just a rear guard action that delays inevitable defeat. The mold will win. The strongest defense is to minimize the initial exposure. Put a lid on it!
Of course, if you are going to finish it off in less than a week, then some open-air time won't matter too much if you refrigerate promptly. But if you want something to last more than a week, it is absolutely critical to keep the spore counts as low as possible. And that means keeping it away from open circulating air as much as possible. I would wager that every bottle of decently pasteurized milk would last at least a month if the milk were dispensed from a pump with a HEPA filter in it rather than poured from the bottle.