I've been thinking about this a lot, and I'm still not sure. Let's face it, Fantasy and Science Fiction tend to have a lot of action which usually ends up in killing. Most of the time as a reader, I want to see the bad guy killed off. However, I hate books that make me want to enter the book and kill the bad guy myself. I admit, I don't like feeling homicidal. I also have a terribly hard time killing off characters in my writing, even when I guess it would be "justified."
Lois McMaster Bujold dealt very well with it in "Curse of Chalion." The main character, in order to protect a number of innocent people, wants to kill off the bad guy. To do so, he has to perform death magic which will kill him (the main character) in the process. He decides it is worth it, performs the magic, but is saved by a miracle. There is no law against successfully completing death magic (only attempting it), since no one has ever lived through it before. The character seems justified in his murder since he was willing to give his own life up for it and there was no other way to stop the bad guy (at least, no available way as the world was set up by the author).
There is a difference between the real world and fiction, but fiction should reflect the real world, in my opinion, or it is pointless. It's interesting how Disney gets around this problem: the good guy rarely kills the bad guy outright. Instead, some force of nature or the bad guy's own mistake kills him. This avoids the dilemma but often seems unrealistic. Wow, I need to stop talking now.