Things are more complex than this. If your view of humanity includes making sure people have something to eat, somewhere to sleep, and don't die from simple preventable medical issues, some amount of investment is a net positive.
Instead of just providing food, shelter, and basic medical care - helping them to get a job turns them into tax providers rather than consumers. Helping them to eat and live healthier reduce the medical cost.
We have this retoric in Denmark in the current political climate. It only works to a certain degree, but the liberals have this wet dream where everybody becomes contributing citizens if we just take away everything and threathen their existens. It just doesn't work that way for everybody.
Instead of just providing food, shelter, and basic medical care - helping them to get a job turns them into tax providers rather than consumers. Helping them to eat and live healthier reduce the medical cost.