I read somewhere that a country's level of civilization was measured by how well they treated their prisoners. I agree.
If, and when we agree, that the penalty for all infractions will be death, we have to contend with the reality that it's better to improve the lives of these people before we release them back into society. Not that I support the death penalty in any case. Anyway, most people in jail are there not because of heinous crimes, and we are not about to start shooting people who stole a chicken, got into a bar brawl, or something like that. It follows that you do not want them stripped of their dignity and learn the tricks of the trade from hardened criminals.
It is no surprise that the countries with the most humanitarian prison systems have the lowest level of recidivism.
And from another point of view, I am human, I believe all people should be treated with humanity, even the worse people. Otherwise we are not better than them. Prisons are not for vengeance, the punishment is the loss of freedom.