In most of the developed world, it's either illegal to sell a network-locked phone, or there's a legal requirement for networks to provide an unlock code at the end of your contract. Locking is generally seen as fundamentally anti-competitive and permissible only under strict restrictions, in order to maintain the economic viability of handset subsidies.
It's entirely reasonable that if your phone is discounted as part of a contract, you should be obliged to complete the contracted term or pay an early termination fee in order to keep the handset. What's not reasonable is the idea that the subsidy arrangement gives a network complete control over your device in perpetuity. Either the device is rented to you by the network, in which case they are responsible for it, or it's sold to you at a discounted price and is yours so long as you finish paying for it.
It's entirely reasonable that if your phone is discounted as part of a contract, you should be obliged to complete the contracted term or pay an early termination fee in order to keep the handset. What's not reasonable is the idea that the subsidy arrangement gives a network complete control over your device in perpetuity. Either the device is rented to you by the network, in which case they are responsible for it, or it's sold to you at a discounted price and is yours so long as you finish paying for it.