Because the carriers still have a certain amount of power over Apple so that Apple cannot just unilaterally make decisions like that.
Second, it prevents promo deals from being abused. Ex. About a year ago Boost had a deal for the iPhone SE for $99. What would prevent someone from buying an unlocked phone at that price and then using it on their carrier and not Boost?
In fact, Boost had such problems with third party unlock services as it was, that the promo had to be ended early.
The problem with questions like this is that they are always asked from the consumer's point of view and not the carrier or manufacturer's point of view. And the consumer often never considers that anyone would or could take advantage of a promo offer when the fact is that most people will if given the opportunity.