The Messenger of Allah ﷺ said, "Whoever has intercourse with an animal, kill him and kill the animal along with him."I asked him, "What is the matter with the animal?"He replied, "I do not think he said that for any reason except that he disliked its flesh being eaten after such an act had been done with it."
حدثنا عبد الله بن محمد النفيلي حدثنا عبد العزيز بن محمد حدثني عمرو بن أبي عمرو عن عكرمة
قال رسول الله ﷺ من أتى بهيمة فاقتلوه واقتلوها معه قال قلت له ما شأن البهيمة قال ما أراه قال ذلك إلا أنه كره أن يؤكل لحمها وقد عمل بها ذلك العمل
Its chain of transmission is hasan. Tirmidhi narrated it in the chapter on Hudud, section on what has been said about one who has intercourse with an animal, hadith no. 1455, and Ibn Majah, hadith no. 2564, both from the hadith of Abdul-Aziz Darawardi via this route.