This question popped into my head when a cryptozoology group host, anthropologist Dale Drinnon, relayed a report about Mongolia's "death worm," reportedly some kind of burrowing animal with a lethal electrical charge. I suggested there might be an undescribed species of burrowing snake, presumably venomous, with a lot of exaggeration and myth added to it. Dale speculated that it would only take one case of a startled person being bitten by a snake and dropping of a heart attack to create folklore about the snake having something more potent than venom.
Cryptozoology in general invites a lot of fun speculation about what has evolved, what has not, and why.
In this example, we don't know of any wholly terrestrial animals of any kind which can use electricity as a defense system or weapon. This may be due entirely to the inefficiency of earth and air as transmission mediums, or also to the fact that electrical sensing apparatus is likewise most useful in water, and this is what electrical weapons or defense systems evolved from.
I like to think about these things in quasi-engineering terms. Evolution is a clumsy engineer that goes off in a lot of unproductive directions and takes seemingly forever to get on the right track (also true of some human engineers), but eventually comes up with ingenious solutions. Sharks in particular have always struck me as beautifully integrated weapon systems, with powerful armament, a striking array of sensors, and various other adaptations all packaged in a streamlined, damage-resistant skin. (As a Christian, I think the eventual rise of an intelligent, self-aware being with a sense of spirituality may be somehow inherent in all evolutionary systems which run for a long enough time, but that's irrelevant here.)
To think about electricity again, an electric eel's weapon system is a terrific dual-purpose (offense and defense) gadget, although there's a cost in giving over much of the body mass to "storage batteries" and keeping them charged. I wonder that no animal ever evolved an extendable electric weapon - an octopus could use a specialized tentacle (or equip the tips of all its tentacles, with the batteries mostly in the body) for offense or defense. It may be that powerful electric cells are something so specialized and complex that, even with the hundreds of millions of years multicelled animals have had to multiply, mutate, and adapt, such cells evolved only once, in the bony fishes.
I've read several attempts at explaining why mammals haven't evolved green fur, seeing as how it would be useful in many environments, and it sort of comes down to "Well, it just hasn't happened yet." The genetic cards have just not fallen, so far, into a set that would yield green fur. Or maybe such a mutation did happen, but the animal lived in rocky terrain and the color was a disadvantage. If we found a green mammal, there would be a lot of buzz about it, but no serious damage to current thinking on mammalian biology or evolution.
I once sparked an interesting discussion on the National Association of Science Writers group by pondering why there are no six-legged vertebrates (including no cases of three paired limbs in fishes). Six legs could come in handy in endeavours like climbing trees, and would increase survivability if a limb was lost. The consensus of the considerable brainpower in that group was that, for a vertebrate, unlike a small arthropod, growing and maintaining a limb is a major investment, and the advantages just weren't worth it. You might say that spider monkeys hit on a compromise by developing a prehensile tail functionally equivalent to a fifth limb.
(And while we're at it, why no color-changing mammals?)