TidBITS iPod & iPhone: Staff Roundtable: Apple Should Do No Harm to iPhones:
Unlocking a phone is not illegal in the United States (nor in most countries). The Librarian of Congress extended an existing right by carving an exemption out of the Digital Millennium Copyright Act (the awful DMCA, which I hope the Supreme Court strikes down one of these days) that allows individuals to reverse-engineer the encryption in a phone specifically to unlock it. Even though unlocking is allowed, cell carriers aren't required to make it easy for you. They can use every tool at their disposal to lock the phone.
The FCC has expressed concerns about how hard it is to unlock phones on a number of occasions, and despite its control by an administration that ostensibly supports less regulation, the FCC doesn't favor locking. In a complaint about the rules for an upcoming auction in the 700 MHz band for future cellular networks, Verizon Wireless proposed that if the FCC prohibited it from locking devices in this new band, that would be tantamount to violating the company's First Amendment rights.
Now, I hold no truck with the notion that companies have constitutional rights. That's part of the erosion of personal liberty in favor of so-called corporate rights that began in earnest in the 20th century. (You can read Peachpit Press founder Ted Nace's book "Gangs of America" on this topic; it's a free download.) But you have to admire the chutzpah that lets a cell carrier assert a constitutionally guaranteed right to prevent choice among its consumers as a matter of "speech."