Just in case you missed it, Engadget did a nice little analysis of whether it's legal to unlock your iPhone or not-- a more and more pertinent question as we get closer and closer to having unlocking solutions become available. In short, it is legal... mostly.
The main questions of legality lie around an exception to the DMCA, which allows you to unlock your cell phone "for the sole purpose of lawfully connecting to a wireless telephone communication network." Under that law and that exception, it's perfectly legal to use an iPhone on T-mobile, Verizon, or any other provider that you can get it to work with. Things really only get prickly when you start selling those unlocked phones, or somehow profit off of selling unlocked phones. Then, Apple and AT&T start to have a case against you for honing in on their business.
Oh, and the other fun part is that the DMCA exemption that gives you an out on this one actually expires in November of 2009. So if nothing is done on that front, unlocking phones will be illegal within a few years. Still, Engadget makes the same conclusion that I would-- unlocking your iPhone for personal use on another network very likely won't bring AT&T's legal goons to your doors. It likely will void your warranty, and while some unlocks brag that they'll stay after updates, a future update may undo the unlock.