Likewise, in agriculture a person may keep a dog to protect his crops so that livestock do not enter and ruin them. The third permissible case concerns livestock itself: a person may keep a dog for his herds—be they camels, sheep, or cattle—because the dog wards off wolves and thieves; the moment it senses a stranger it barks and its owner is alerted. In the same manner, if someone needs to safeguard property—for instance, a person living in a remote area with no security personnel nearby—and therefore keeps a dog, that is unobjectionable, for it, too, is a form of protecting property like guarding farmland. Anything beyond these exemptions is unlawful.
Part of Allah’s wisdom is that the foul are matched with what is foul, and the foul are attracted to what is foul. It is reported that the unbelievers among the Jews, Christians, and Communists in East and West each keeps a dog—Allah’s refuge is sought. When they buy meat, they give the choicest portions to the dog and eat the inferior cuts themselves. They wash the animal daily with soap and other cleansers, yet even if they bathed it with all the waters of the seas and every soap on earth, it would never become pure, because its impurity is inherent; an inherent impurity is not removed except by the complete destruction and disappearance of the substance itself. Such is Allah’s wisdom: He makes these corrupt people attached to what is corrupt, just as they are attached to Satan’s whisperings. Their unbelief, after all, is a product of Satan’s inspiration and command, for Satan enjoins indecency, wrongdoing, disbelief, and misguidance. They are servants of Satan and slaves to their passions; they are vile and befriend what is vile. We ask Allah to guide us and them.
The essential point is that keeping a dog without a legitimate religious reason is a major sin, and the impurity of a dog is the vilest of impurities. Among animals there is no impurity more severe than that of the dog, for if it laps from a vessel, the container is not purified until it is washed seven times, one of those washings with earth. With other impurities, once the physical substance is removed the place is pure, but for a dog the vessel must be washed seven times, one of them with earth. Allah is the One who grants success.