i think they're dealing more in frostycology... your basic fast food customer won't think a small is big enough, but they don't want to feel like a pig and get the large, and they probably sell more mediums than L or S, which i'm sure they've noticed in their spreadsheets. why not raise the margin? plus, let's be honest, most of us just assume economy of scale will apply without doing the math.
and in addition, ithe medium is an even worse deal than you thought compared to the large.
20oz @ $1.99 = 9.95cents/oz. 16 oz @ $1.69 = 10.56cents/oz. 12 oz @ $1.19 = 9.92cents/oz.