So when I talk about deterrence I'm mostly talking about reoffenders. I.e, the prisoners I talked to coming back. I think they're more likely to commit crimes after prison, not less!!
Do you think people would lie, in a heavily monitored prison, about wanting to never come back to prison because they'll "die in glory" in a gun fight against the cops next time so they can't be arrested? Or about becoming a drug kingpin? Sounds like you think I'm saying these people were claiming nice things about themselves, but really they're mostly claiming quite bad things if it makes me think they're going to be back and were strongly negatively influenced by peers in prison.
On the topic of regular people who prison serves as a deterrent for, I'd look at other countries where crime rates are lower without the same hideous institution. Clearly it's not just horrible prisons which prevent noncriminals from committing crime, since so many countries don't have that? I guess that's up for debate.