The problem is that in a prison most of the people there are going to be criminals, and will end up socializing each other in ways that act against reform.
Though another part of the problem is that whenever you have a justice system anyone singled out by it as a criminal is going to have an easier time being trusted by criminals and a harder time being trusted by non-criminals in the future.