Keeping them out of prison isn’t always the best bet.