Government hasn't just failed to solve homelessness, government is directly responsible for a substantial portion of it.
In the 1970's, there were 'urban renewal' and 'slum clearance/improvement' projects in many US cities, aimed at things like getting rid of 'residential hotels' and rooming houses (often by requiring expensive parking places per room which such businesses couldn't afford to supply and who's customers didn't use). This led a large number of the residents of such places winding up on the streets.
In the 1980's, there was a big move to 'deinstitutionalization' of the mentally ill and severely developmentally disabled, returning them to live in the regular community. This was not matched by the kind of support and services in communities these people need to be able to live successfully outside of institutions, leaving many of them unable to manage at all and landing on the street.
This leaves aside the vast amount of wealth that government action since WWII has prevented being produced, and all the other problems, of all sizes, governments have created.
My favorite example of how governments screw up housing is New York City rent control. Things are so screwed up that the best thing that can happen to both owners and tenants in some apartment buildings is for the place to burn down. This puts the tenants at the top of the list for public housing, and allows the owner to redevelop the property as something more profitable.