Housing is the most critical problem societies face today regarding the basic needs of human beings. As you pointed out, the most rational thing for builders is to build to the highest price point they can. In the theory of capitalism there should be builders wiling to mass-produce 'decent' housing at lower profit per unit but sufficient total profits.
That has not happened. When the capitalistic economic system fails internally like that, and the matter at hand is a basic human need, government simply must intervene. A governmental solution cannot be rejected on the grounds that it is 'bad economics' when the failure of the economic system is the problem.
Society exists for its members--all its members--not the other way around. There are better ways and worse ways for government to intervene in the housing market, but when the alternative is a dearth of decent housing any intervention that provides that basic human need is better than no intervention.