It does actually. See how thieves resident in Florida travel to New York to work because of the different enforcement regimes for one of the clearest possible examples[1].
Even if deterrence didn’t work at all putting people in prison is good because of incapacitation. Committing crimes is stupidly right tailed[2]. Every career criminal in jail for a year is a year society doesn’t suffer their crimes.
[1] https://www.realclearpolitics.com/video/2024/02/02/cnns_john...
[2] https://sk.sagepub.com/ency/edvol/the-sage-encyclopedia-of-e...