Anyone know of any historical basis for this? In what religious tradition or culture is animating undead evil?
In the real world, Egyptians and some other cultures prepared special guardians of sacred sites from the ranks of volunteers (and *ahem* "volunteers") who were slain and then submitted to special rituals designed to make them into eternal guardians.
In fiction, there are examples of undead of various kinds that defend persons, objects and even cities- or even avenge wrongs. Fritz Lieber's Sons of Kyuss are one such example..they are the former nobility of the city of Lankhmar who occasionally rise from the dead and wander the streets of their city. In Disney's (that's right!)
Chitty-Chitty-Bang-Bang, spirits are called up to animate suits of armor and defend England. Even deceased King Arthur is believed to lie in wait to be summoned to do the same. The heroes of Valhalla could also be considered undead of a very special kind, though they seem never to leave the plane of Asgard. Jason (of Argonauts fame) cast dragon's teeth into the ground to summon the spirits of slain warriors to do his bidding. Orpheus
almost raised his wife.
Ghosts and Mummies are not neccessarily evil, by their descriptors.
Using positive energy is good because healing is good.
Going all the way back to 1st Ed, Mummies are linked to the Positive Energy plane, not the Negative.
There's also something akin to undead - the deathless, they are notliving, but they're good instead of evil.
As for the "Deathless" vs "Undead" distinction, I have always thought of that as a particularly large load of titan-crap. Its a distinction without a difference. If it walks like an undead duck and quacks like an undead duck, its an undead duck.
That D&D inflexibly tries to eliminate good-aligned undead is, IMHO, weak.
In my campaigns, there are good versions of the undead-creating spells...but they are EXCEEDINGLY rare.