Why does milk contained in cartons of milk expand?
The likeliest culprit here is fermentation carried out by bacteria present in the milk. Fermentation of a sugar, for example glucose, releases carbon dioxide (a gas) : 

$$C_{6}H_{12}O_{6} \rightarrow 2 C_{2}H_{5}OH + 2 CO_{2}$$

Since this reaction produces a gas, the gas builds up in the milk carton causing it to bulge. This is not, generally, a good sign, make sure to smell the milk before drinking it!