1. Removal of social offender from society
2. Rehabilitation of non-conforming individuals
3. Punishment enough to deter future offenders
There's a tangental argument about whether or not incarceration achieves these goals, but the social stigma from being incarcerated isn't the point of any of these goals, and is instead just a cultural byproduct.
Those are just bad ad hoc consequentialist justifications for incarceration. If you really believe that, you can justify life sentences for every minor crime. Since it keeps criminals off the streets and increases utility. Or you can justify having incredibly short sentences. Since the correlation with longer sentences and greater deterrents is pretty small. Criminals tend to think they won't get caught and have high time preference. And I doubt it's terribly effective at rehabilitation.
You can certainly justify discriminating against people with criminal records that way. It's by far the best predictor of job performance. High social trust is probably the most important aspect of a society. Letting known criminals get into positions of power is not an ideal way to achieve that.
The main reason we have prisons is justice. The basic human desire for fairness and consequences for wrongdoing. No one wants to see a murderer get away with it. Even if there is some compelling argument why punishment won't increase utility. For instance, people tend to strongly oppose having sentences done by statistical algorithms. That are vastly better at predicting recidivism than human judges. Because they feel unfair.
And that same desire for fairness is also why people prefer criminals get a second chance.