The last time there was an unfettered free market in housing was when pioneers were driving wagons west and just claiming land and building a log cabin by hand. And the natives nearby might have had some opinions on whether that was OK to do.
In the modern world, there are lots of housing-related taxes, tons of regulations on how the house is built, the house needs to be attached to a government-controlled sewer system, electrical system, water system, sometimes a gas system too.
To some extent that regulation is a burden, but developers also see it as an opportunity, because they can pass costs on to home buyers. They choose when, where and how to built in order to make as big a profit as possible. The government sets the rules of the game, and the property developers play that game to get the maximum score possible.
If the government pretends that it's a free market, they're letting the property developers play the game unopposed. It's even worse when the government creates incentives to build new housing and the property developers just find some way to pocket that subsidy and then keep playing the game the same way.