This would usually require government intervention to mitigate. What are more examples of this? Is unregulated health insurance a market failure? In an unregulated insurance market, most people would be unable to pay for comprehensive care, which undercuts the motivation to buy health insurance.
'Market failure' is endemic to many industries, particularly those that prey on the poor. Some are not 'market failure' by the strictest of definition, but they are contracts of adhesion, i.e., they are predatory. In more honest times, they would be considered unlawful. For instance, I consider payday loans to be in this category.
At its most basic, market failure is when price and quantity are unable to reach equilibrium. 'Equilibrium' means that the market agrees to a price per unit.
In the example above, people who are homeless, lack material resources, particularly money, and people who are renting or selling homes expect money as consideration in return for use or ownership of their domicile.
A Keynesian approach to market failure would be an injection of money by the government in order for price and quantity to reach equilibrium. This could be in the form of vouchers for the homeless to pay for use of the homes. This benefits the homeless since they now have a home, and this benefits the homeowner because they now have a tenant.