I noted a couple of days ago that the jails are full of people with mental illness or substance use disorders, that incarceration does not do anything to help these people, and that we would have less crime if we were to decriminalize possession or sale of small amounts of controlled substances, and divert people who commit non-violent drug-related crimes to treatment and supportive services instead of prosecution. Well, maybe I didn't spell all that out quite as explicitly as I could have, but that's what I'm arguing for.
However, that obviously does not account for everybody who is incarcerated. I need to explain something that not everyone knows. There are two main categories of state carceral institutions in the U.S., called jail and prison. It doesn't work exactly the same way in every state but the basic idea is that jails -- often run by counties rather than the state -- house people who are awaiting trial, or who have been sentenced to one year or less. Prisons, run by the states, house people who have been convicted and sentenced to a term of more than one year. The federal system houses far fewer prisoners, although it does house some of the most notorious.
Anyway, you will read arguments that most of the people in prison have been convicted of serious felonies, including violent crimes. This is true, although it is not true of most people who are incarcerated at any given time. There are several arguments for why people who commit assault, armed robbery, rape, murder, grand larceny, and some other serious crimes, should be incarcerated.
The first, and most persuasive from a purely pragmatic point of view, assuming it truly works, is deterrence. If there are people who would be inclined to commit such crimes, and after reflecting on the risk of incarceration choose not to, then the penal system may have a large social benefit. This proposition is obviously difficult to test empirically -- we can't do the experiment of creating a law free zone -- but it's likely true in some cases. If some people who are otherwise morally unconstrained conclude from observing the experience of others that crime doesn't pay, they may refrain from crime, or at least do less of it. But I can't say how large an effect this has. Many crimes are impulsive, or committed by people who are reckless, heedless of consequences, or driven by compulsions.
The second reason is simply disablement. For as long as a person is incarcerated, they aren't a threat to the larger community. Of course a limitation of this argument is that most prisoners will be released sooner or later, and imprisonment might make them more, not less likely to offend again. There are pretty good arguments for the former, at least under some circumstances, but individual cases vary. There is no doubt but that some people will say that they don't reoffend because they don't want to go back to prison. What the ratio is or the net effect is impossible to say, however.
That said, there are some people who are so dangerous that the public would not tolerate them being released. There are psychopathic serial killers and rapists who won't control their behavior no matter what. I must say, however, that this not true of everybody with a very lengthy or life sentence, but it's hard to know the difference. At least we can say that serious crimes committed by people who are in their teens are not necessarily evidence that the person will not develop a conscience and impulse control when they are mature. The adolescent brain is not fully developed.
The third reason is simply an abstract concept of justice. People who are harmed by criminals, or who see harm done to others, want vengeance. The condemnation of the larger society is, to many people, an end in itself. We have to mark certain behaviors as reprehensible, and the criminal justice system is how we do it. I think there's a lot to be said for that. (The question of exactly what behavior is reprehensible can be controversial. For example, Oscar Wilde was incarcerated for being homosexual.)
What this all comes down to for me is that we need to make sure that we incarcerate people for only the right reasons. Having a substance use disorder or engaging in consensual sexual conduct that is disapproved by a particular religion are not among them. Second, we have to think of most prisoners as people who will eventually be released, and we need to treat them in a way that will reduce, not increase, their risk of re-offending. The impulse that much of the public has to make the condition of prisoners as punitive as possible is totally counterproductive. People do not create themselves, we are all the product of forces we do not control, from our genes to the circumstances of our childhood, to possible psychiatric disorders, traumatic experiences, or desperate need. The question of what really ought to happen in prison is for later.