I think even the benefit for the less fortunate here is at most a short-term one. In the longer one, you need building and renting out shelter to be reasonably profitable, so that people do it.
It's basically the same argument that says rent caps are bad for the renters in the long run.
We don't always have to consider the apparently very fragile and fickle motivations of investors. Social housing can and has worked very well in many cases.