Why do you think the prison guards and the warden believe that it is acceptable to treat the prisoners the way they do?
Simply put, the characterization of the prison authority's attitude towards the prisoners is using them as means to ends, as opposed to ends in of themselves. This is shown at several points. When Hadley beats up an inmate so badly on his first night, he is doing so to prove a point to the other prisoners. In this, Hadley is treating the inmate as a means to an end. In this case, it is exertion of his own power. Another instance is when the guards punish one of the "sisters," Bogs. This was done to protect Andy, who is being used as a means to an end. When the Warden subcontracts out the prison workers, he does so in order to promulgate his own image and profit greatly from their working. In this, the prisoners are being used as a means to the Warden's self- serving ends. It is here where the dehumanization of the prisoners is embraced because they are used as means to specific ends. They are never treated as ends in their own right and because of this, the authority of the prison makes it easier to mistreat and dehumanize the prisoners. Darabont makes it clear that there is some level of justice that Andy exacts on all of them at the end of the film, and in doing so, he is able to right that which is wrong in terms of how human beings are treated while at Shawshank.