An excellent point.
This was successfully done with Mitchell-Lama[0] housing, which provided more than 100,000 housing units (both rental and cooperatives) in New York.
This program was begun nearly 70 years ago and has been quite successful.
Unfortunately, similar programs have not been implemented elsewhere and the rate of new Mitchell-Lama housing development has slowed to a standstill.
Revitalizing Mitchell-Lama and creating similar programs elsewhere could spur development of lots of "affordable" housing.
Sadly, governments in the US seem to be more interested in maximizing real estate values than in housing its residents.
I should have included mention of this type of development in my previous comment[1] about revitalizing small towns. I'd posit that such programs could be quite helpful in those types of efforts too.
[0] https://en.wikipedia.org/wiki/Mitchell%E2%80%93Lama_Housing_...