Pets are our responsibility. Hence, it is permissible for us to care for them to the best of our ability as long as it does not constitute any form of cruelty to the pet and does not contradict Islamic teachings. Neutering or sterilizing a pet is permissible as it is not considered as a form of cruelty towards the animal itself unless the procedure is performed when it is still conscious. A comparison can be made with similar procedures performed on humans such as ligation and vasectomy which does not constitute any prolonged pain.
Hence, there is nothing wrong with sterilizing an animal as it does not involve any prolonged pain. It is also not a form of changing Allah's creation as it is performed with the intention to lessen the number of stray cats and uncontrolled breeding. What is forbidden is changing Allah's creation without any valid reason.