There are three overall reasons for incarceration and all of them are valid.
- Retributive justice is important for society. People, on the whole, need to see wrongdoers punished and the moral order upheld. It's part of deterrence.
- Keeping wrong 'uns off the streets so they don't reoffend. More specific deterrence for those individuals by removing their means and opportunity.
- And finally rehabilitation. The other reasons are very valid, but we definitely don't focus on this nearly enough.