Have you read Foucault's Discipline and Punish? He makes a good case that the purpose of prisons to isn't to stop crime, but to create a criminal class that can be treated as the "other", encouraging people to identify more with the state.