Generally, D&D undead work out as evil because negative energy is more or less the antithesis of all life. Aside from liches, most undead exist because of either being murdered by some other type, sheer hatred, or a necromancer decided they'd be useful. Because of what they [i]are[/i], the mindless ones are not the biggest fan of 'living things'. Plus living people tend to not appreciate walking corpses that attack and eat them.