The federal prison system abandoned the concept of rehabilitation back in the 1970s. The current system is a combination of exile (we don't want you around), some punishment (this place sucks) and some mitigation (if you're in jail then you can't do more crimes). I do not believe that potential criminals are the sort who are capable of thinking something like "I better not do X, I don't want to be in jail that long".
There's a YouTube channel called "Insider" and they have a series of videos called "how crime works" which are part interviews with past-criminals about how their particular scheme worked:
The videos all have extensive credits and one thing was that very few of the participants actually considered potential punishment/incarceration beforehand.
Obviously it depends on the crime, but I dont think it is so much that criminals never consider potential punishment, but that they dont think they will be caught.
To this end, perception of the likelihood of being caught is far more important than the severity of punishment when it comes to deterrence.
There's a YouTube channel called "Insider" and they have a series of videos called "how crime works" which are part interviews with past-criminals about how their particular scheme worked:
https://www.youtube.com/c/thisisinsider/videos
The videos all have extensive credits and one thing was that very few of the participants actually considered potential punishment/incarceration beforehand.