Why can teenage boys get chemically castrated in a hospital but inmates in a prison can't get it because they say it's inhumane. Is it inhumane?

Many years ago there was a prison in Florida that made the news. There were a number of pedophiles that begged the people at the prison to be chemically castrated because they had no other cure and didn't want to be a pedophile when they were released from the prison. But the prison said it was inhumane and released them only to carry on being a pedophile and hurt innocent people.
But a hospital like Vanderbilt was recently in the news because they chemically castrate boys under 18 with no problem. All he has to do is find a doctor and ask to have it done for sexuality reasons. The hospitals get a lot of money to do this.
Do you think chemical castration is indeed inhumane and these doctors do it for the money? Are they breaking the law?
Why can teenage boys get chemically castrated in a hospital but inmates in a prison can't get it because they say it's inhumane. Is it inhumane?
Post Opinion