All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
With regard to killing dogs, then there are three kinds of dogs:
1) A rapacious dog: according to the consensus of the scholars it is permissible to kill it, as Al-Haafith Al-'Iraqi said.
2) A dog which is permissible to keep for hunting, guarding, and so forth; this kind of dogs should not be killed according to the consensus of the scholars .
3) A dog which does not fall into either of the above two categories: the scholars differed in opinion about the ruling of killing it; the view we adopt here in Islamweb is that it is forbidden to kill such a dog without any sound reason, because dogs are a nation among different nations, and the Prophet disliked killing it with the exception of a pure pitch-black dog, which is permissible to kill.
As regards castrating dogs, then the Muslim jurists stated that it is forbidden to castrate an animal the meat of which is forbidden to eat, as this is torturing the animal and abusing it, and changing the Creation of Allaah. The dislikeability of killing the dog is due to the fear of exterminating it, and the breed of dogs should not be cut off by castration.
Allaah Knows best.