Prisoners must be allowed to sue if their rights are violated. If they could not sue, there would be no incentive for the state or federal prison systems to respect prisoners' rights.
An example of this can be seen in the recent Supreme Court decision about prison overcrowding in California. If prisoners truly are being held in conditions that are inhumane, they need to have some way to rectify the situation. If they could not sue, they would need to rely on elected officials to push prisons to alleviate the problems. This would surely never happen because prisoners are not a sympathetic group. Therefore, prisoners who could not sue would have no way to force authorities to respect their rights.