The way I read the article it's mandatory because, well, because it says it's mandatory.
"Both the California and Florida statutes provide for mandatory injections for repeat sex offenders..."
The law forces adult sex offenders whose victims were 12 or younger to begin the treatment at least a month before getting released on parole and continue until a court determines that they can stop.
As far as I can tell, it is constitutional to enforce severe rights restrictions and penalties on convicted felons, even after their release. That appears to include medical procedures far more invasive than microchipping.
If anyone has any information about rulings suggesting that medical procedures enforced against convicted felons are unconstitutional, let's look at that rather than dig farther and farther into the weeds of chemical castration laws or argue about the definition of "mandatory".