In some ways the prison system in the U.S. seems to be worse precisely because it is supported by a democratic society. If prisoners are tortured under a king, their barbaric treatment can easily be associated with the cruelty of the king. This connection creates a risk of revolt, and a sensible king will be mindful of it.
In a democratic society with a Kafkaesque prison system, torture of prisoners is not as easily associated with any one person's cruelty. Because most people are optimistic and don't like to believe that several hundred million of their neighbors would silently condone the torture of a whole class of people, it's easy for lazy minds to consider prisoner torture acceptable, necessary, justified, and so on to whatever stronger beliefs these individuals may hold.
I'm not saying that prisoners would fare any better in a non-democratic society, but how people think of prisoner mistreatment would definitely be different.