This is an interesting question, I look forward to reading other responses. The ASPCA write that veterinarians have been recommending spay/neuter since the 1900s. More scientific research was performed in the mid-20th century to examine effects of spay/neutering and determine best practices.
Humans have been castrating livestock and other humans for millennia, so it's likely that some pets snuck in there once or twice. Here is a Girolamo Romanino stucco in Trento, Italy showing a cat being castrated, ca. 1531-32.