Deterrence has never worked on potential criminals.
It is simply a matter of results. Being punitive might hurt them, but it hurts society more.
When a percentage of a society might be lacking for basic needs they will act in bad ways for the society. A UBI doesn't remove all desires to commit crime, but it would remove everyone who would steal to eat or steal to house themselves.
It removes an entire class of threat to society. What does a punitive measure buy for society?
It certainly won't deter crime, because no society has ever been able to punish hard enough to deter crime and there have crime societies that killed petty thieves.
It won't reform the ex-cons. It will make doing things like buying a suit for a job interview more difficult. It will make them less likely to contribute by way of work. Money they might have spent on bettering themselves (books?) must now be spent on survival.
Again, do away with childish notions like "earn" and "deserve" they map poorly onto the solutions for the problems of the real world.