The social and economic benefits of rehabilitation far outweigh any costs incurred in rehabilitating folks.
Communities would be wealthier and safer if we didn't penalize convicted persons for the rest of their lives, by denying them jobs, housing and access to the financial system.
And since we do penalize folks that way, is it any wonder they turn to more potentially lucrative illegal pursuits?
And the economic argument is even stronger than the social argument. All those folks could learn skills and provide boosts to local economies if they were allowed to get decent jobs. That would improve overall GDP and provide a strong incentive for convicted felons to walk the straight and narrow.
Is it necessarily easy? No. But it makes societal and economic sense.