Moff Tarkin (aside from insulting many folks' intellects while himself making spelling and grammar errors) is only thinking in terms of Machiavellian and utilitarian ethics, and is completely ignoring the importance of deontological ethics, as he is only considering the consequences and their utility while ignoring the morality and nature of the act itself. This, class, is called a fallacy, one that many folks like to indulge in because it makes them feel better about their immorality. This is the sort of ethical fallacy that makes people like certain tyrants/terrorists/megalomaniacs (who will not be named, since EN World isn't a proper place for politics) think they're in the right. Pfffft. So I have a very low opinion of anyone who thinks 'the ends justify the means' or anything like that. Killing one person to save a thousand people is still an immoral means to a moral end. Doesn't mean it's always wrong, but it's never a morally stellar thing to do, especially not if the victim is an innocent. Obviously it's 'right' to kill a tyrant or something, but killing is still an evil act in and of itself, though the purpose may be benign in that instance.
Anyway, in D&D, morality and ethics are made somewhat black-and-white by the Alignment system. Some things are capital-E Evil, some things are capital-G Good, etc. In D&D, anything Machiavellian or utilitarian is going to be either Evil or Neutral, with few or no exceptions. In D&D, slaying an evil creature is considered to be just and good simply because D&D has a B&W Alignment system, such that destroying evil is always good and vice versa. However, it is not honorable/lawful to just destroy any evil creature encountered, thus paladins for instance need to have a compelling reason to slay an evil-doer, such as knowing that the villain is in the middle of executing a very evil act (not just petty theft, for instance, but rather murder or something). So paladins in D&D should only slay evil creatures that are commiting acts of great evil (murder, starting plagues, starting horrible wars, instigating natural disasters, spreading worship of evil deities, constructing evil artifacts, opening Gates to evil planes, consorting with fiends, desecrating holy sites, assaulting holy men, etc.). Only lawful good folks in D&D are typically concerned with the honor of an act as much as the morality of the act. Slaying any ol' random guy on the road who detects as evil to a Detect Evil spell is perfectly alright for a chaotic good or neutral good character in D&D, with its B&W Alignment system, but would not be acceptable for a lawful good character since it would be dishonorable (non-lawful) despite being good in the context of D&D. Lawful good characters will generally be concerned about the deontological morality of any act (doing only the pure and virtuous) rather than the utilitarian morality of it (i.e. ends justify the means).
Casting Death Knell is an Evil act because it channels Evil power. Casting Animate Dead is an Evil act because it channels negative energy, which is an Evil act. Casting Inflict Serious Wounds is a very minor Evil act because it also channels negative energy, but only a relatively small amount (thus, it does not have the Evil descriptor, but D&D still says that channeling negative energy is Evil, and that doing that too often will turn a character Evil). In D&D, negative energy is linked to evil while positive energy is linked to good, to an extent. Animating a corpse requires a great deal of negative energy, and binds an unwilling soul to keep the corpse animate, thus it is quite Evil. Not to mention the moral and cultural revulsion to such an act. Most undead in D&D have unwilling souls bound to them for animation, and this prevents those souls from enjoying any afterlife or oblivion. Some undead, like liches, are likely to have been willingly changed into undead, and thus have their own original soul in control rather than 'shackled' to the corpse merely for animation; however, even these undead are animated only by the vast amounts of Evil negative energy filling their corpse, which naturally has a very corrupting effect on them.
Casting Raise Dead, Resurrection, True Resurrection, or the like is not an Evil act in D&D because it only returns the person to life after an unnatural death, such as from being murdered or poisoned to death. None of these three spells allows anyone to live beyond their natural lifespan, and if they have a patron deity, it also doesn't allow them to return to life if their deity is opposed to that. Raise Dead et al won't return anyone to life if they died of natural causes or whatnot, so it does not have the taboo of Animate Dead et al (as becoming undead, especially becoming intelligent undead, shirks the whole mortal coil deal and makes the creature immortal, denying the natural order of things and whatever the gods may have set forth as the mortal lifespan; it also throws mud in the face of religious beliefs, like saying 'screw you Cuthbert, I'm going to live forever and do whatever I damned well please, so I'm never going to suffer any rightful punishment in some afterlife! Nyah nyah!'). Now D&D isn't real life and doesn't always adhere to the real-world taboos and cultures, of course, but it is possible that some people will run D&D campaigns in settings that are more based on some other real-world culture that has different views on death, so these nonstandard settings may use houserules regarding Animate Dead, Resurrection, etc., but that would be the exception not the rule.
Lastly, regarding some of the D&D-related stuff that's been mentioned so far in this thread.... 1. St. Cuthbert is a lawful neutral deity with slight leanings towards good, and his clerics always turn/destroy undead rather than rebuke them. This means that St. Cuthbert, while neutral on the good-evil axis, disapproves of undeath, on top of being a somewhat honorable deity as well. So his priests would never condone the creation/animation of undead for use in labor, fighting evil, or vengeance. Wee Jas, on the other hand, would indeed approve of such uses for undead. 2. Animating the dead so they can strike back at those who murdered them is still an evil act and still channels negative energy. At most it may be considered a neutral act if the purpose is righteous enough, but it would still require channeling a considerable amount of negative energy, which is still an evil act and still has some corrupting effects on one's mind and soul. Just like summoning a fiend with Summon Monster spells; it won't make you evil right away, but if you do that with any regularity or consistency and you'll be corrupted into an evil villain soon enough. 3. It is possible to have non-evil undead in D&D, such as Archliches and Baelnorn in the Monsters of Faerun book, but these are special exceptions made through very rare and powerful magicks. These good or neutral undead are animated by positive energy or have enough positive energy in them at least to stave off the corruption of the negative energy making their corpse animate. It's much more difficult to accomplish, thus there are no rules in D&D 3E/3.5E on how it's done, just as there are no artifact-creation rules for the same reasons. Deities could of course create undead guardians who are akin to archliches (even if they're ghosts or vampires or mummies or whatnot), and it's stupid to think that deities would be limited to only the spells and templates presented in the rules; just look at Deities & Demigods, there are plenty of deities there with unique abilities that just go to show that deities are not limited to only what Player Characters (good or evil or otherwise) have at their disposal. Besides, each DM makes their own decisions on how deities will work and how they may or may not be restricted in his or her own campaign. Also, mummies in D&D may be evil, but that's just the standard used in D&D for most undead, such as vampires and liches, and it's well within the DM's purview to base their D&D campaign off of cultures or whatnot that the standard D&D assumptions don't support; that's why there's houserules.