I do believe there are exceptions to this. I cannot remember where, nor quote a book or some such, but somewhere I remember reading about how it was a relativity common occurrence for good half-elf wizards to becomes liches. Despite being outcasts in a pure human or pure elf society, they would assign themselves as the protector of their respective town out of loyalty and become a lich so that they could continue to protect the town from evil forever. They would then remain in hiding, but would protect the town with their magic from afar.
If I'm correct and not just delusional, than that would be an example of undead not necessarily being evil.