Unlocking phones isn't in the same scope at all. Locking a phone in the first place was done because carriers were subsidizing phones so they needed to ensure they stayed on their networks. An "unlock code" for root access to a phone is a giant security flaw and a potential vector even for anyone that doesn't want the functionality or care to root their phone. The fact that the option could exist for someone to bypass security is, in and of itself, a security risk. The specific reasons I buy iPhones for family and staff is because I know they can't do those things, even if they wanted to. I want them to have smartphones so they can run specific apps or connect to our servers but I don't want even the possibility of those devices being compromised.
You call it a prison. I call it a fortress.