I do not have any references about this, but many Western laws have been carried over from our Jewish/Christian backgrounds. Bestiality is forbidden in the Bible numerous times, e.g. in [Exodus 22:19](https://www.biblegateway.com/passage/?search=exodus+22&version=NKJV):

> Whoever lies with an animal shall surely be put to death.

As for the *need* for these laws: one thing that comes to mind is that intercourse with an animal without proper protection can result in new [sexually transmitted diseases](https://en.wikipedia.org/wiki/Zoophilia#Health_and_safety), causing not only danger to the offender's health but also to other people.  
Under some (all?*) conditions it's animal abuse, but there are separate laws for that.

*<sub>: I've been told that e.g. cows don't feel anything from the act; after all, sometimes a vet inserts their entire *arm* into a cow's rectum during an examination. I don't think it's necessary to discuss this; I usually try to avoid the subject.</sub>