I'm confused by this objection, if you draw a stereotypical supply and demand curve, you can see how prices settle to an equilibrium point. Of course reality has more complications, but I think your objection is 95% answered by a supply and demand curve. You keep building houses when it is profitable. You stop when it is not. This naturally keeps everything in balance.
I have struggled to understand why houses don't get built and land sits idle for years. I can only assume that it's significantly more complicated. I'm not trying to excuse the complications. I guess if the house prices are forecast to go up, you build some houses, but not all that you can because the longer you wait, the higher the profit will be on the ones you start later. If house prices are going down, even if it's profitable when you start, you're not likely to build houses because you might be left holding houses that will sell at a lower margin. If there was a tax on unused land, that might skew things towards building more even if prices are declining, but I'm sure there are lots of views on that.
Some would say that housing is a right (while acknowledging the need for housing construction and its workers and supplies to be paid for) and that it should be funded somehow, even if the free marker profit becomes negative during certain periods. Like any market manipulation, the question then would be how to intervene to keep housing construction going when construction isn't profitable, while not fomenting corruption in the industry.
If a minority has most of the wealth then the equilibrium supply may include a lot of supply of second homes, very large homes on large plots for the rich, properties sold at a premium based on how much they can extract from renters, and even investment properties occupied by nobody whilst still having insufficient small basic homes and dense housing.
Capital that could be invested in better serving the bottom half has to compete not only with the use of those resources to further enrich the rich but other investment opportunities.
What do you do when that equilibrium point is hopelessly above what the average person can afford?
Sure, so long as the balance involves not housing people which is pretty sick and twisted
Free markets for housing are likely to settle into an "optimum" where some percentage of people cannot afford housing at all, because while construction/rental of housing for them would net a return, it's not worth the opportunity cost. Plus you should not wait for the market to respond to a lack of housing: people will be homeless in the meantime. Supply/demand is mostly reactive, because building for anticipated future demand years down the line is very risky, so most investors don't like that.
Markets don't optimize for "everyone gets some", yet that's precisely what you need for housing. You'll always need the government to come in at some point to provide for those left behind by the free market.