Limiting the iPhone to AT&T was a very bad decision and I think allowed Android to get a foothold in the premium cellphone market. I knew a bunch of people who wanted iPhones but couldn't or wouldn't switch to AT&T.
I don't think Apple limited it to AT&T per se - they wanted a very different model than previous phones, with previous phones the manufacturer's customer was really the carrier, not you, and the carrier dictated most things about the phone - so, for instance, on Verizon you could buy music and ringtones only from Verizon, the phone and the screen were covered with Verizon logos, the "internet" was likely a Verizon portal, and you didn't really interact with the manufacturer at all. (FWIW my wife wouldn't let us switch to AT&T - I ordered our iPhones he moment they hit Verizon - the one for her was almost an afterthought, she didn't think she'd use it much - soon, they were inseparable.)
In contrast to previous phones, Apple wanted a direct relationship with the customer, and most carriers weren't willing to give them that much control. They shopped it around, and only AT&T (Cingular at the time) was willing to give it a shot. Presumably they got a limited time exclusive contract out of it. Blame that on the other carriers, not Apple.
This, I think, is one of the most fundamental changes that Apple brought to the smartphone world and it is often overlooked. You're no longer buying songs from AT&T's captive portal for $3 each, now you can buy songs from Apple, or install your own songs from iTunes (and maybe those are .mp3's purchased from, say, Amazon), or stream music from a dozen competing services, who are competing directly for your attention, rather than competing to try to get the streaming music exclusive contract with your carrier. Before you had to pick your carrier based on coverage, price, phones offered, and the quality (or lack thereof) of each and every service they offered (J2ME application store, music store, ringtone store, etc.). Often a lot of these services you didn't so much choose as decide to put up with to get the phone or the coverage. Now you can buy your preferred phone, pick a carrier based on coverage/speed/price, and then choose from many different companies for music, movies, etc. That's a huge win for consumers.