I agree this rule is ridiculous. It is much better to have people help themselves then forcing them to be helped by taxpayers.
The idea behind banning illegal immigrants (as well as legal asylum seekers) from working is to disincentivize them from coming in the first place. That's somewhat rational. But it becomes problematic when people subsequently blame these people for being unproductive. Sure there's always lazy people, but also plenty of people who happily work harder than most western europeans.