I think it's shortsighted to just throw up your hands and say "because free market" in this kind of scenario. The fact is if "market" salaries for software engineers are based on unicorn thinking and the salaries that Apple, Google and Facebook can pay, then there won't be much of a long-tail of interesting companies, we will all end up working for mega corps.
Supply of developers that both meet the high bar and are willing to accept poorer economic futures (see eg housing costs that have doubled in the last 5 years, expensive childcare, etc) is low. My experienced mid-career engineering peers keep moving to Austin, Seattle, and various cities in the midwest because being able to get a house for $300k, $500k, or $250k, respectively, massively changes their financial outcomes.
Then they can't compete in that market. Market salary is not a high bar, it's the expected fair wage. If you can't pay market salary, you don't belong in business.