It's sort of bollocks though, isn't it? Let's be honest, we all start off in a massive deficit with our 18 years of free schooling and education before we contribute anything. Whereas immigrants often come pre-educated. But the problem is that issues with immigration are only ever used as a way to whip up hatred or fury, so sensible stuff never gets talked about. For example, it was clearly ridiculous that someone working in the UK could get child benefits at UK levels for their kids still living in Eastern Europe. And there clearly could be a sensible solution to that, but no, we had to have it presented as scrounging foreigners sponging off the welfare state. Let's be honest, what it really highlighted is the ridiculousness that people working full time are still having to claim benefits to have a reasonable life in the UK.
The other issue with this idea of the deserving and undeserving poor is that there are people in need of help who haven't built up a bunch of social contributions and never will. What about someone with disabilities that prevent them from working who is never going to contribute enough in taxes to pay for the cost of their care? Or someone who grew up in and out of social care, never got a decent education and as a result, suffers serious mental health problems and can't hold down a permanent job? Or the person who had to quit their job to become a full time carer. So what starts as undeserving immigrants or asylum seekers quickly morphs into "She's not disabled. I saw her mowing the lawn the other day." Or the odd exception who does game the system used to suggest that the whole system isn't fit for purpose when it actually helps millions and the country as a whole.
We also get the likes of military veterans, poor pensioners, nurses, etc, used to attack other 'less deserving' people, by people who have no intention of helping those groups either. People who will happily fight to cut firefighters' pensions while arguing that they're more worthy than someone fleeing a war when it suits them.