There's an alternative approach which mirrors the public healthcare concept of "public option". Instead of restricting government housing to means tested individuals or specific low income populations, you develop a public competitor to drive prices down and to eat costs in regions where housing is needed but the economics just don't make sense yet.
i.e. the US Postal Service model. It works extraordinarily well as long as you don't repeatedly capture and handicap the org/agency (like has been done to the USPS). And even with the USPS despite being severely handicapped it still provides immense value by driving prices down while maintaining the essential service of last mile delivery.
A similar approach could be envisioned for a public construction agency.
When the options ar homelessness or subsidized housing, subsidized housing is absolutely the best option, which is backed up by decades of data.
If the government just went on a building binge of housing to be sold at market rate, or even set an upper bound before qualifying to buy them at a middle class income, it’d work out fine. That’s basically how Singapore does it only they couple it with somewhat aggressive policies to encourage people to downsize their living situations once they’re empty nesting to free up family dwellings for people with families. We probably wouldn’t need to do that second part since we’re not a claustrophobic island, and could just count on natural turnover.