First, there is a template for a good necromancer in one of the expanded books. I found this Good Lich template online today. The following is a long explanation I posted for my players about my world specifically. It goes into a lot of details and interprets some of the logic of the books in a way that hopefully helps explain why Necromancers tend toward evil.
Two things to note about this really long post. First, I talk about how necromancy spells cut a piece of the soul of the person and trap it. This is the decision I made for how they work based on my reading of the rules. Second, this is all wrapped around the concept of how D&D interprets undead creatures and spells tagged [Evil].
Finally, before my explanation, I wanted to note that by RAW it is impossible.
"A Touch of Evil: A dread necromancer cannot have a good alignment. This could make it difficult to fit the character harmoniously into some groups."
Necromancy is an interesting subject in D&D. Notably, we can find that most necromantic spells are defined in the books as [Evil] and yet there are many supplementals that note the possibilities of good liches, or undead guardians sent to protect the innocent.
I won't go over the arguments for both sides, I'll simply explain how things work in my game. For this, however, I will be as detailed in my logic as possible.
As part of being an evil cleric you obtain the ability to "REBUKE" undead. This means you can control them, and tell them to fight for you instead of against you, or simply to go away.
As part of being a good cleric you obtain the ability to "TURN" undead. This means you can cause them great fear, or even destroy them. This is extreme. There isn't a druid ability that is obtained at FIRST level to instantly destroy an animal that has decided to attack the party, even if that creature is a vicious wolf under the control of an evil druid for the purpose of killing the party.
We should compare these abilities to those of the other 2 major casting classes, druids & mages.
Druids have abilities similar to command, built into spells they can use, and their natural ability at 1st level includes the ability to communicate with plants & animals, but not to control them. Druids eventually gain spells to slay living creatures, but so does every other casting class, so these spells are irrelevant of this discussion. Druids never get the ability to call upon the power of being a druid (aside from spells as explained) to instantly kill a creature, even if that creature is attacking them.
Mages never get any such inherent ability, but must rely on spells to control things--even the addition of bloodline abilities for sorcs & school abilities for wizards has not changed this.
Since neither of the other two casting classes obtain a similar ability, and the ability itself is based purely on alignment, I'm forced to assume this ability is changed in this way BECAUSE of the cleric's alignment, and not for any other reason. This means, by my understanding, that the act of DESTROYING undead creatures is a GOOD action. This means (which you'll see in the Morality vs Alignment section) that the act of DESTROYING these creatures is HELPING them or the world in some way.
The deity Sarenrae (Neutral Good) explains that next to fiends and the helplessly evil, undead are among those that must be cut down and killed since no good can ever come from them. All others, she deems that her followers must try to teach and convert them. This is a consistent perspective in D&D and Pathfinder. Undead are perceived as "unnatural" and "abominations" which must be "destroyed". I have yet to see a good deity perceive undead as a positive thing. In fact, I've yet to see a good deity hold a "live & let unlive" attitude toward these creatures.
From this I have deemed that undead are a problem. They may be summoned by a cleric for the purpose of "cleaning the laundry" or "doing the dishes" so that a small part of the world is a better place, but even these acts must somehow be "wrong" in the eyes of good clerics, and so the undead in and of themselves are a bad thing in the world. If destroying an undead is helpful to the world, then the act of creating them must be Evil, so this fits perfectly with the theology expressed in the books and all necromantic spells can stick with the alignments listed in the book. Animate Dead, Create Undead, and Create Greater Undead are all Evil spells, acts which are evil by their very nature.
If that's the case, then how are they evil? The components don't give a big hint. We're not exactly talking about using the blood of babies to animate these creatures. It's simply magic controlling bones which makes them act as though they're still alive, right? Well, that never made sense to me. First of all, if that were the case, why are we limited to holding the form of the creature that originally existed, why not each bone be pointed out like a spikey monster so that it can simply grapple things to kill them. For that matter, if you're controlling each bone in that skeleton, why not use them individually as weapons. Surely that can't be more complex than the act of balancing while walking and swinging a sword (especially for a wizard with no such proficiency).
Furthermore, there's a tagline about undead creation in both D&D and Pathfinder. It goes something like:
You can only control so many undead at a time. If you create more undead than you can control, the excess creatures are uncontrolled, but are not destroyed
So the creation of undead is not individual magical control over the bodily structure. Instead, you're bringing the corpse/skeleton to life. You're creating life?!? That can't be. No spellcaster in D&D can create life. There are those that can reanimate the dead such as "Ressurection" "Raise Dead" and "Clone". These spells are of a very high level, and undead can be created at very low levels. The separation means these creatures are, as described in the books "mindless".
As a side note, the mindlessness of undead is a fine point. The undead CREATURES aren't necessarily evil. As explained, they may just be washing dishes. This is a strong reinforcement of my point that it is the ACT of CREATING them that is Evil.
There is another creature in D&D which is more or less "alive" but has no mind of its own. They're called constructs. These "creatures" have been infused with magic and animated. But in D&D constructs, and the creation of them, is not tagged as an inherently Evil act, though it is extremely difficult to do. Interestingly, it's also never mentioned that there's a limit to how many constructs you can control. Since this is the only real difference (other than hitpoints) between the two acts, I must determine that it is THIS, and this ALONE, that is the difference between the Evil act of creating an undead creature, and the Neutral act of creating a construct. After all, both of these qualify as "unnatural" and many constructs could be considered "abominations" (see flesh golem).
But why is control necessary? If these creatures are truly "mindless" what might they do if left to their own free will? With the exception of Ghosts (for obvious reasons), undead creatures are listed as evil. Left uncontrolled they will act like a disease, killing & infecting others as they wish in my world. It's that simple. Undead, uncontrolled, will pursue harm. They will try to hurt people. but you just said they weren't bad creatures I did. I'll get into that in a bit.
If they're actions are evil, and the act of creating them is evil, but THEY aren't inherently evil, then there's something that is missing from the puzzle. In order to disassociate undead from constructs, I have determined that undead have a desire. They may be mindless, but they have a need, a want that must be fulfilled. This seems to fit most definitive lore. Zombies want braaaaaiiiins. Vampires need blood. All undead have a want, and what they want is directly correlated to life. Undead creatures are killing in order to obtain that touch of life that they're missing.
In order to make all of this make sense, there is something you must understand about the manner of the animation/creation spell in my world. The spell, the very act itself is an extremely low level step in the direction of the ultimate in Necromancy spells (yes, look it up) the 9th level spell "Soul Bind". The act of creating an undead creature is evil, because it involves taking a small piece of the SOUL of the creature that originally inhabited the body, and BINDING it to the pieces that are left.
In real life, we have done similar evil acts with corpses. There are cultures that remove the feet of their enemies after they kill them so that they may not walk through the gates of the afterlife. There are cultures who remove the eyes and scalps of their enemies so they are permanently disfigured and may not see what heaven looks like. We have had much experience in real life with defiling corpses, so consider D&D necromancy the magical equivalent. Instead of simply defiling the corpse, it's damaging the soul of the creature.
This fits perfectly into the rest of the D&D lore that I'm seeing. After an undead is destroyed, what's left is not enough to be reanimated. The part of the soul has been removed from this world and can't be dragged back without another corpse to attach it to (e.g. the person was cloned, reincarnated or true ressurected and a new body formed/used). This also explains why it is a GOOD act to destroy the undead. Even if the undead's purpose is solely to do laundry, it's very EXISTENCE is HARMING someone. The act of destroying the undead releases that piece of the soul, thus helping the person in the afterlife, and not harming anything other than smashing a bunch of rotting flesh.
So that about sums it up. I'm following the book here. With the exception of Ghosts (unfinished business), all Undead Creatures are evil, because they commit evil acts trying to seek out a taste of life. The creation of undead is evil because the caster is defiling the soul of the creature being animated. The destruction of undead is good because it is repairing the soul of a creature in the afterlife.
There are caveats here. The "good lich" is the first one I'd like to address. Even the book explains that such a being is "Extremely Rare". Allow me to clarify. The act of becoming a lich (as defined in the books) is an act of GREAT EVIL. To be a GOOD person who has committed "GREAT EVIL" is not necessarily impossible, but the rarity should be obvious. I won't go into ways I perceive this could happen as I wouldn't want to ruin anyone's role play.
Second, is intelligent undead. Because the spell is higher level, it should be obvious that is more powerful than it's lower-level counterparts. When using higher level spells to create intelligent undead, it requires binding of a larger portion of the soul to the corpse. As a result, the creature gains an intelligence. The intelligence is NOT that of the creature that was killed, but simply a general ability to learn and understand as any intelligent creature. Intelligent undead STILL pursue destruction of life when not controlled.
Third, is ghosts. Ghosts that chose to stay behind of their own will may be any alignment. Ghosts created by necromantic spells are evil.
Finally, a word on Liches in general. The act of becoming a lich requires an act of great evil as defined in the books. This is equivalent to drinking the blood of a newborn that the wannabe lich has just slain (actually worse, but I don't want to get too descriptive here). The creation of a phylactery is considered the epitome of necromancy. This fits with all of the above, because it involves not only the mastery of soul binding (the level 9 spell) but the ability to bind one's soul and use a piece of it to animate the lich's corpse, allowing the destruction of the lich's corpse to return that piece of the soul to the rest of itself. Additionally, it works similar to Clone, which is another level 9 spell. I recommend that both of these spells be on a caster's spell list if he/she wishes to pursue lichdom, but I can imagine some of my players may manage to role play their way around this rule.