Starting Jan 26, 2013 unlocking your phone becomes illegal according to the Librarian of Congress who determines exemptions to the DCMA law, unless you ask the permission of your carrier first. This is a pretty big deal.
Up until now you could unlock your phone to be used with a carrier other than that you’ve purchased from with a phone service contract. By looking up a special code or downloading a tool online you could easily unlock your phone without having to buy an unlocked one for full price. Carriers do this to restrict the use of the phone to their service in exchange of a low price and a service contact.
Some carriers like T-Mobile will have their marketing plan affected as they were promoting their service by giving discounts to people who bring their phone from other carriers.
On a side note, unlocking is not to be confused with jail-breaking a phone which is enabling it to run different software than that restricted by the manufacturer.