A manufacturer had to have a relationship with carriers to move enough product to make its prices affordable even off-carrier. Manufacturers who couldn’t sell through carriers were effectively made uncompetitive by the carrier cartel, that also resulted in a number of other restrictions (how one can pay for stuff etc). In this sense, as I wrote elsewhere, Apple strong-arming ATT was a big step forward; but it also took legislation on this side of the pond to force carriers to play nice with unlockings, there was no chance the market would self-correct.
Which takes me to the second point: the market alone often does not self-correct. This is why we have antitrust laws and authorities to enforce them. People lack the education to be able to reason about “voting with their wallet” in an effective way; and even when they do, they often don’t have the resources to follow through. This is why contract bundles are so popular, despite the fact that they make handset more expensive overall: people can’t do math, and when they do they still often lack the cash reserves to buy a handset in one go rather than paying small instalments for a long time. If a market fails, it’s legitimate for the law to step in; and one indication of failure is the level of discontent from consumers.