All though, I disagree with HaShem that raped animals should be killed because of their evil owners...
I don't think this should always be the solution in the modern world. For example what if you had a pet horse that you cared for very much, and found out one of its caretakers you had hired to help you had raped them once or a few times before being caught. The animal isn't ruined and isn't trained to be that way just from those few encounters. Some vet care and gentle care to get them over being traumatized would be enough in such a case.
I can however think of a couple of reasons why this would have been wise at the time it was written.
First, imagine a stallion at one of those beastiality farms is trained to do unspeakable things to people who want that. Then the people are caught and the stallion goes to live somewhere else. Keep in mind that most horses are much more powerful than a human being. What if a child for example ends up being around that animal and the unthinkable happens? This is one of the dangers of "trained" animals.
Just like, you wouldn't put a bite-trained former police dog in a home with a toddler, you really don't want a horse that's trained to do those things around people that it can overpower (which would be most people) or to escape.
Another problem with a habitually abused animal being allowed to live is that other people who are in to that kind of thing and know about the animal will seek such animals out to abuse them again and again, which is cruel to that animal.
So I think that it really depends on the case. If it's an animal that can be dangerous, or an animal that is at high risk of being further abused it's probably best to put them down. If it belongs to someone who is not abusive and there was only abuse one or a few times then it's probably best to try to heal the animal and make sure it's in a better environment where this will not happen again.