In Judaism dogs are considered to be unclean, way back when the Torah was written dogs were still traveli9ngin packs, scavenging for garbage, and sometime human corpses. These wild packs of dogs often carried many diseases, and could be dangerous, which is probably why humans tried to stay away from them.
Dogs, however are not all that bad in the Jewish tradition, this is because the dogs stayed silent when the Isrealites began their exit from Egypt, and the Talmud says Jews should "tolerate" dogs. The Talmud also speaks of dogs as faithful creatures to their masters as protectors, and even speaks of God giving Cain a dog as a symbol of his protection.