Once again, what do you do with your spells?
If you're a chaotic evil wizard, you might fireball people who make fun of you, who used to make fun of you when you were a kid, just to blow off steam, etc.
If you're a lawful evil wizard, you might use your spells to kill people as efficiently as possible. If you're facing an army, don't hurl fireballs at them, just use improved invisibility, nondetection, some nasty save or die spell, and teleport (for if things go wrong) to assassinate the army general. Think Artemis Entreri: he's good at killing people, but he only does it if he feels he needs to.
Lawful characters can go to war and kill foes if there's a good reason. For instance, if by defeating the evil king's army you can save the peasants from some terrible fate (taxes? sacrifice?) then sure, you can try to kill your foes.
BTW animating dead affects the spirits of the dead (not necessarily the spirit that once possessed the body), so it's often viewed as evil.