If that happens, you're doing it wrong. The point of helping people with social programs is to ensure (ideally) no one falls through the cracks and becomes an even bigger cost to society, so they can eventually contribute to society again instead of being a cost to it instead of getting trapped in poverty.
Of course, some people are not well enough they will ever be able to contribute to society, but providing them with the basics is less expensive to society than not doing so.