Maybe to have it as a required part of his sentence, so while time can be reduced, perhaps the castration can’t? I.e. he couldn’t be released early unless he went through with the castration.
I dunno, I’m not a lawyer, just my guess. Fucked up either way on all sides of this.