This isn’t done for free however, landlords are renting out whole units or portions of their units in exchange for rent from the government and non-profits.
But that is the best case scenario. Some are offering up spare-bedrooms in exchange for rent from these organizations.
Participation is weak though, and has caused the end of some of these programs before they even get started because of the lack of participation. San Francisco is getting creative, but it appears that creativity is not as popular as they would hope.