it has something to do with the exception to the DMCA that was granted. IMNAL and this is WAY over simplified, but... basically the DMCA says that you cannot circumvent encryptions and softwares that protect ip and copyrighted materials etc.
this can also be legally translated that the SPC locking access to device funtions is a control put in by a content owner restricting access to device functions in accordance with how the device was intended to be used. (while you pay for the hardware carriers ofter assert that the software loaded on a phone is subject to some sort of licensing terms)
congress granted a specific exemption to mobile phone unlocking saying that the subsidy codes did not fall under the DMCA and thus if someone owned the hardware they should be able to do what they want with it, however the exemption was not perminent and they reserved the right to re-examine the issue at a later date. that date is approaching, and that date may pass without congress examining this again. however it does not mean it becomes illegal, it only means there is no longer anything on the books specifically allowing this. there is still nothing specifically prohibiting unlocking either, except for the broad scope of the DMCA (does not specifically prohibit mobile phone unlocking)