Well, killing an animal without a reason is unlawful and sinful, but permitted due to need or to gain benefit. This “need” includes an animal becoming severely sick such that there remains no hope in it recovering, and as such, it would be permitted to have it killed to end its suffering and pain,
“It is permitted to slaughter a cat or dog for a benefit. And it is better to slaughter a dog if it is close to death.” Imam Ibn Abidin comments, “… for in slaughtering the dog, one is relieving it from pain. Tahtawi said that this ruling is not restricted to a dog.” (Radd al-Muhtar ala ’l-Durr al-Mukhtar 6/474, Kitab al-Sayd)