If the prisoner's basic human rights were being denied through the poor conditions, then he has a right to challenge on this issue, whether he is a despicable piece of dirt or not. Human Rights are universal and even the lowest of the low are entitled to them.
Poor conditions in prison are a major factor in the high rates of prison suicides, and mental health problems are also extremely high amongst prisoners.