Narrated Abdullah ibn Abbas: The Prophet ﷺ said: If anyone has sexual intercourse with an animal, kill him and kill it along with him. I (Ikrimah) said: I asked him (Ibn Abbas): What offence can be attributed to the animal/ He replied: I think he (the Prophet) disapproved of its flesh being eaten when such a thing had been done to it. Abu Dawud said: This is not a strong tradition.
The values taught by this hadith include respect for all living creatures, abstaining from immoral behavior, following Islamic teachings and laws, understanding consequences for wrongdoings etc.