To help the homeless it is not needed to give him a home. It is much better for example to give him a job so he could afford a rent. It is always important to figure out a real source of the problem.
Obviously, you are quite right. We should not give a shelter to a homeless person. We should give job to him. As a result of this, he can manage to live properly. And also, he can make end's meet. This is the best solution in my opinion.