One possibility is that because soft drinks are often consumed directly from the container, the extra cost of storing cylindrical containers is justified because they fit more comfortably in the hand … But even if most people drank milk straight from the carton, the cost-benefit principle suggests that it would be unlikely to be sold in cylindrical containers … Most soft drinks in supermarkets are stored in open shelves, which are cheap to buy and have no operating costs. Milk is exclusively stored in refrigerated cabinets, which are both expensive to purchase and costly to operate.
That's Cornell economics professor Robert Frank, the latest 12-gauge economist to write a 'Look! Economics is all around you!' book for people who like to communicate exclusively through trivia.
The real answer to this question, though, comes in the comments:
The cylindrical shape of soda cans is not for hand comfort. The sides of a rectangular container of carbonated soda would either bulge out or have to be made too strong and stiff to be cost-effective. The cylindrical shape resists bulging with much less material.
Soda cans and bottles are a marvels of engineering. Over time, they have managed to use less and less raw material to make each one while still being able to contain a pressurized beverage without bulging or rupturing. If you think about a cylinder, the top and the bottom are both flat, and not as efficient at resisting bulging as the cylindrical part. Now you can understand why soda cans all taper a bit at the top (a smaller flat area resists bulging better than a large flat area) and why the bottoms are built bulging inwards (takes much less force to bulge a flat area outward than it takes to turn an inward bulge into and outward bulge).
It's amazing how much of the world around us is designed to be exactly how it is, whether we notice or not.
Now: Does anyone have a plausible explanation for the big divet at the bottom of wine bottles? Or those five little legs on the bottom of soda bottles?