What's it called when someone who's been incarcerated for so long that when they're released they aren't able to function well because they're more comfortable in jail.
The term institutionalized is often used
(Of a person, especially a long-term patient or prisoner) made apathetic and dependent after a long period in an institution.
Oxford Dictionaries Online
Note that the term is used for people who have been in other types of institutions, such as mental hospitals.
In the movie Shawshank Redemption, Red tells Andy that Brooks has been in Shawshank for so long he was "institutionalized."
Some of these recidivists know they want to go back to jail; and some are subconsciously trying to get back to jail. On the other hand, some recidivists do not want to go back to jail -- but have bad habits, or are not willing to make all the sacrifices needed to follow the law.
Institutionalized is the right term, but I'd like to mention a related term:
Stockholm syndrome refers to positive feelings towards captors, but applies to those who are injustly held (hostages, POW's, concentration camp inmates.)