You shall not bring a prostitute’s wages of the exchange of a dog to the Temple… (Deuteronomy 23:19)
We may not sacrifice an animal that was received as a prostitute’s wages for her professional services, nor one that was exchanged for a dog. Even if a prostitute was paid with 100 sheep, or if a dog was traded for 100 sheep, all of the sheep are prohibited as sacrifices.
The reason for this mitzvah is that these things are distasteful. For a prostitute to offer an animal she earned as part of her wages is like a thief donating part of his stolen wealth to charity–it’s no mitzvah at all. In fact, it’s nothing more than a transparent attempt to whitewash one’s misdeeds.
As far as the exchange of a dog, it smacks a little of offering a dog on the altar, which would be reprehensible. Also, in our society we may think of dogs primarily as friendly pets but historically they were bred as vicious attack animals. There aren’t many dogs in the Bible but the ones we do see are hardly Lassie or Rin-Tin-Tin. In Exodus 11:7, the Jews need to be reassured that dogs will not attack them when they leave Egypt. In 2 Kings 9:36, Queen Jezebel was eaten by dogs. In many other places, the term is used disparagingly. For example, Proverbs 26:11 says, “As a dog returns to its vomit, so do fools repeat their folly.” So, encouraging and rewarding dog-breeding is not much better than encouraging and rewarding prostitution.
This mitzvah applies in Temple times. It is discussed in the Talmud in tractate Temurah (page 29a-30b). It is codified in the Mishneh Torah in the fourth chapter of Hilchos Issurei Mizbeiach. This mitzvah is #100 of the 365 negative mitzvos in the Rambam’s Sefer HaMitzvos.