The optimal outcome for them is to use that to get people locked into their service for two years, and give them a device for $0 that a company without a contract would have to ask $200 for. They're not stupid, at some point somebody surely said "hey, what if we sold these phones for a higher price unlocked" but then everybody laughed and that guy felt like an idiot.
I honestly doubt that. I have often heard people say "hey, that phone only costs 10€ with O2, but 100€ with T-Mobile" and stuff like that. It never occurs to them to compare the rates they would get without a phone with the rates they get with the phone.
Probably there are lots of psychological studies about that (similar to the x.99cent prices in supermarkets). But that is why maths is important (among other things) - because it can protect you against the failures of your brain.
Whereas I can go out tomorrow and buy a macbook at the prices Apple advertises during WWDC, the same isn't true for the iphone. Hence the confusion.
The optimum outcome of this would be for phone companies to give up the practice, as it only enrages customers in the long run.