I can’t speak for all other animals, but I imagine it’s often for similar reasons as why they do it for cats: removing the hormones means they’re much less likely to display unwanted behaviors such as marking/spraying, territorial aggression (fighting) towards other cats, and roaming. Those behaviors all stem from the desire to mate, and if they don’t have testosterone from the testicles, they don’t experience the desire to mate. Unless you don’t mind the smell of concentrated cat urine everywhere, adult male cats with testicles don’t make very great house pets.
With female cats, they completely remove the ovaries (rather than doing a tubal ligation) for similar reasons. If they did a tubal ligation instead, the cat would still go into heat, meaning lots of yowling and trying to escape, and an increased risk of marking/spraying, just no longer able to get pregnant. In my region, they also usually remove the uterus, but it appears that varies globally.