Government can work on the issue of homelessness in many different ways, but it is important to note that the problem of homelessness might never be solved entirely, since our form of government in the United States, at least, allows people the right to remain homeless if they so choose, and there will probably always be some people whose choice this is.
First, a substantial part of the homelessness problem is mental illness. Thus, to attack homelessness, the underlying problem must be solved. Many years ago, we de-institutionalized most of the mentally ill, with the assumption that there would be community resources to help them lead normal lives. Those resources did not exist, which exacerbated homelessness a great deal. Those homeless who are mentally ill need clinics and hospitals to treat them, and the government could fund such institutions. Once the underlying problem is addressed, with therapy and/or medication, most mentally ill people can lead full and functional lives.
Second, while homeless shelters are of great benefit, preventing many homeless from freezing to death, they are generally privately funded enterprises, often with religious affiliations that proselytize the homeless while they are there. If the government were to provide more homeless shelters without this limitation and also provide full social services, rather than just beds, the homeless would get help in finding affordable housing, help with learning how to live day to day, and help with becoming socialized sufficiently to properly enter into all the transactions that most people must enter into when they are in their own homes.
Third, there are many communities that have laws that make homelessness illegal and even a few that have made it illegal for people to feed the homeless. This has the effect of pushing the homeless even more "underground," preventing them from remaining in the communities they want to be in and getting even some kind of help. So, this sort of law or ordnance should be done away with, a strategy of eliminating legislation that simply makes things worse.
Fourth, government can provide affordable housing for people, based upon their income levels, so that anyone who wants to not be homeless anymore can afford housing. Right now, it is my understanding that government housing and government subsidized housing are insufficient, with long waiting lists for many people, and in particular, there is a shortage of what is called Section 8 housing, which is private landlords who agree to take subsidized tenants. This is a problem that affects the homeless, since they, too, if they want housing, are likely to be on a waiting list. Someone homeless who is on a waiting list is going to be difficult to find if housing does become available, and sufficient housing would mean that a homeless person could simply move right in.
Finally, homelessness that is not rooted in mental illness is largely a problem of poverty. There are plenty of families out there who led middle-class lives and who are now homeless, as a result of job losses and mortgage foreclosures. It is easy to say that government should just solve the problem of poverty, but this is a complex problem. Nevertheless, it is a problem that can be solved through government job creation, which is what the government did in the Depression, and which we really should be doing again.
Can any of these interventions happen? On the national level, the political climate is such that this is unlikely. However, there are some local governments who are trying to address the problem in some of these ways.