Prisons are run, first and foremost, to protect the public from the actions of the people imprisoned, secondly, to deter others from criminal acts, and thirdly, to punish the offender and provide a degree of retribution to the victim(s) of the crime(s). Rehabilitation is the fourth purpose of a correctional system, but that purpose is subordinate to the other three purposes. As it should be. Some people cannot be fitted to live law-abiding lives, but those that have deserve protection from those that won't.
I actually agree there are such people, but the irredeemable offenders are only a part of those sent to prison. If anything the way prisons are run are only serving as criminal schools for people who are getting there for relatively lesser stuff. So rehabilitation should get more priority than it's getting now. And there are lso other way to punish/control certain type of offenders than just locking them up.