@David cv,
Depending on country it is already done.
Hard labour,chaingangs,prison farms
Voluntary work while incarcerated gets minimal pay etc
The option as voluntary will at least not require quotas and enforcement through violent means(beatings) or witholding of priveledges like food,bedding(yes bedding)or outdoor sunlight and isolation.(legislativ brutality encouragement)
The question is what kind of work is beneficial in a crime and punishment related way.
Some experiements are already implemented in disaster relief bushfires/floods,comunity work as replacement for incarceration.(Anti social behaviour treatment)
It really depends on the moral standards of the Nation in question.
Forced labour in Europe compared to Africa or America is implemented differently
Have'nt goverments/corporations turned their populus trough a monetary reward/tax system into working slaves anyway?