This article from Chai Online cites a psak from R' Shlomo Amar, then Rishon leTzion, that spaying or neutering a companion animal or pet is not forbidden under the general prohibition against mutilating animals, due to a concern of tza'ar ba'alei chaim (causing unnecessary suffering to animals).
Due to the Torah prohibition of castration, this seems a bit far-fetched to me, especially considering that the above article seems quite intent on instructing people to neuter or spay their animals. (see Shulchan 'Aruch Even ha'Ezer 5:11)
Does R' Amar actually permit neutering a companion animal or pet and what reasoning does he bring?