This is the key. I really don't believe punishment works. I'm on mobile at the moment so it would be tedious to find sources, but I will do so later when I have time.
But a great example for this is with parenting. A child doesn't learn why changing their behavior is beneficial to them outside the context of punishment if punishment is used. They simply learn to hide the behavior, because it is the punishment itself that provides the negative feedback. Showing the child why a specific behavior is detrimental to them gives them negative feedback about the behavior itself. One of the best ways to show this to children is by appealing to their empathy. "Would you like it if X did that to you?" That's a simplistic example.
But in education, the examples are numerous. And for reasons that may be obvious prisoners won't necessarily be in education for say, a math degree, but they would be taking courses in history and philosophy, and the like. Humanities courses give the perspective that crime-affected communities often lack. And they give hope and possibility by exploring all the realms of human thought
Incarceration is inhumane. It does not work. How can someone possibly have hope for changing their behavior when they are treated like an animal in a cage? it does nothing for reinforcement since their freedom after a served sentence is likely to entail returning to a broken community.