Billy Hayes is not a guiltless, red-blooded hero here and Parker doesn't portray him as such. Hayes committed what would have been a crime in any country-- smuggling heroin-- and he was caught and rightfully prosecuted. He has broken laws and must pay the price.
Just to be on the safe side--
-------------MINOR SPOILERS HERE-----------------------
Hayes is initially handed a sentence by the Turkish court-- approximately 4 years-- that would probably be considered fair in any civilised society for his activities. The prison is tough (it's not supposed to be a cakewalk), but Hayes accepts his punishment and overall stays out of trouble while in the prison. Then, with little more than two months left in his term, and the prospect of release dangling before him, a higher Turkish court-- for obscure and apparently contrived reasons (making someone an example)-- suddenly comes back basically saying he's going to spend the rest of his life in prison for his one earlier slip. At this point the moral compass, as it may be, shifts to Billy. He's done his time, he's behaved, he's accepted his punishment and it's hardships, and suddenly the rug is pulled out from under him.
To all the hot-bloods here who say Hayes was a rich American who deserved what he got-- have you ever heard of the concept of proportionality in law? Hayes did not commit a violent crime against anybody (both in terms of his initial act and up to the time the appellate court extended his sentence), he did not even commit a property crime like stealing or burglary. This is what Parker is saying-- Hayes was in the wrong for smuggling and was justly punished for those four years, but the arbitrary extension of his sentence close to his release, and the sheer length of the term (pretty much a lifer), are grossly disproportionate and unbecoming of a civilised society. In many if not most countries, even many killers are usually sentenced to far less than the 30 years that were suddenly tacked onto Hayes's term, and they don't experience the sort of sadistic torture meted out by the wardens in the jail in this film. It had the stink of scapegoating, and the rest of the film shows Hayes's desperate attempts to survive and escape a system that has become corrupt.
For what it's worth, I'm not an American and I don't in any way harbor illusions of superiority on the part of the West or East. One might make similar criticisms of things like the "3 Strikes Law" in the USA which are also pretty arbitrary. Parker isn't commenting on which civilization(s) is/are superior-- he's saying that there are some universal civil liberties that any civilised society should strive to, and societies both west and east fail when they deny them to the most vulnerable people, namely those sent to prison and stripped of even the freedom to mix with the general population. And note, furthermore, that the Turks in the prison (the vast majority) suffer as much as the foreigners. (BTW, to the commentators who've stupidly claimed that this film is merely "American propaganda"-- Alan Parker is British. If you're going to hurl an accusation like that, at least get such a basic fact straight.)
BTW I've been to Turkey and I've found the Turks to be among the world's most generous and kind people, esp to strangers. And sometimes I do wish that Parker had included more Turkish characters with more agreeable qualities, which (even in a prison) one would be likely to find (and I also found the "comparison to pigs" comment in the courtroom to be inappropriate). But Parker wanted to make this a gritty film with an air of desperation throughout, and for this reason alone one should be careful about extending what's seen in this film to the Turks as a whole.