The killing of characters can be a sad or happy occasion. I recently wrote a scene where I killed a character that I happened to like. Unfortunately, it had to happen. Her death is the catalyst for one of my other characters realizing that she's really not in a good situation. It's the reason that she leaves that situation. If her death didn't happen, my main character couldn't learn what she needs to learn, and the story would never move forward.
The problem is that, as I was writing the scene, I wanted to cry. I wanted to put the book down and walk away. Pretend I had never written that scene and act like she was still alive. That's what I do when I'm reading a book, so why can't I do that when I'm writing it?
Characters, much as we may not like to admit it, are just tools that writers have to use. Yes, my characters are now all yelling at me about how they're not just tools, and how dare I refer to them as such, but we all know it's true. They're how we tell a story, and sometimes that means that we have to kill them. Or have something horrible happen to them. (And now they're all cowering in a corner and promising to be good if I just don't kill them. Too bad for them I'm a particularly morbid author, and plan and killing most of the Muahahah!!)
*Ahem* anyway. The point of the matter is that it's a necessary evil. Our characters have to sometimes be killed for either a plot point, or to motivate another one of our characters. It must be done! And what you need to remember (okay...and maybe I need to remember too) is that those reactions that we're having, where we're practically crying or just plain angry that we had to do it, that is what our readers are going to have too. They're going to be the ones crying, or throwing their books across the room and declaring that they're pissed and how dare we (as the authors) kill off their favorite character. Do we even realize what we have done?
That is what motivates me to continue. Despite all the protesting from the characters who die in my head. Or the other characters telling us that we can't do that to them. What are they going to do without that other character? I keep reminding myself of what it will be like the first time someone tells me that they threw their book across the room. (Which is a good thing for me...as that's what I do when I'm angry at something in a book)
More than anything I want to evoke emotions in my readers. I want them to cry, to yell at the books, to throw them. Whatever they have to do. I don't care. I just want people to feel what I felt when I wrote it.
That is the goal of any writer.