I wouldn't want to see that. That's called slavery!
And no, the severity of the crime does not (IMHO) justify it.
Just to play devil's advocate, you're okay with forcing a criminal to sit in a room for the rest of their life, but you're not okay if they also have to work for society during that timeframe. What is the main argument why the first case is okay and the second is not.
If you aren't already seeing it, it's because you're eyes are closed or you're intentionally looking away: https://www.epi.org/publication/rooted-racism-prison-labor/
Slavery as punishment is actually allowed by the constitution...
AMENDMENT XIII
Section 1. Neither slavery nor involuntary servitude, except as a punishment for crime whereof the party shall have been duly convicted, shall exist within the United States, or any place subject to their jurisdiction.
https://www.archives.gov/milestone-documents/13th-amendment