I used to read articles about convicted child molesters or serial rapists being chemically (or even physically) castrated, but I don't think the courts order that sort of thing these days. I believe that sexual predators are controlled by a lot of other factors, not just the hormones created in their testicles. Castration only solves a few problems, but probably creates even more complicated legal ones.
We had a case in our city where a school janitor ran a sex ring involving underage students. He would befriend children who seemed especially vulnerable, then offer them money or other things in exchange for sex. He had been doing it for ten years before a victim finally reported him. The judge seriously considered chemical castration, because it was obvious this man was mentally ill and obsessed with sex in general.
The judge finally ordered him into intensive counseling and ten years in prison. He wasn't convinced that castration alone would make the man less of a risk to society.