Similar reason why there's no death penalty. If you get the wrong person and you lock them up you can release them with compensation, it won't fix it but its better. You can't un-castrate someone the same way you can't revive them after an execution.
Courts convict innocent people all the time, hence no irreversible punishments.