There's a lot of truth in that, but it's also an oversimplification.
There is plenty of cheap land in California, here, have a quarter acre lot for $15K:
https://www.redfin.com/CA/California-City/Princeton-Ave-9350...
Of course it's cheap since nobody wants to live there. If everyone wants to live in San Francisco, it's going to be much more expensive. Building more helps but in the end there's only so much that can realistically be built in 50 square miles. Some people will always be left out so there will always be some unmet demand, so it'll never be dirt-cheap.
So yes policy obstruction is a thing, but there are also inherent reasons why popular places will never be cheap.
I guarantee you're not talking about homeless people here, but people who live in a home that they are renting, reasonably near the place they work.
edit: also, somehow these so-called poors are always wealthy programmers trying to buy million-dollar houses.