My friend and sometime co-blogger Wink likes to think of God as the author of creation in a much more literal way than most people do. He sees God as writing a story, with human beings as some of the main characters, and one response he has to the problem of evil is that the story overall justifies certain instances of badness occurring throughout the story.
This also serves as a helpful analogy for him in thinking through the relation between divine sovereignty and human freedom, since the characters in a book can easily have free will of whatever sort you'd like even if every step of their fictional lives is written by an author. Within the story, their choices are all free. They make choices, and those choices need not be determined in any way by anything outside their control (although if it's a story in a deterministic world, then of course something outside their control does determine their actions, and they at most have only compatibilist free will).
It was hard to resist thinking about the author theodicy when I heard this quote on a recent podcast (see writeup here) by the executive producers of Lost:
We're sorry that it happened, but we're not sorry that we did it, and we make no excuses for it. It is a very intense and dark time on the show. Obviously the deaths of these characters provides a tremendous emotional catalyst for the survivors, because now they're at war. The sides were a little hazy before now. Now, there's great clarity. -- Damon Lindelof
Then consider the specific reasoning given:
We felt it was really important that the audience understand that, going into the end of this show, nobody is safe. One of the problems in television is that you innately know that certain characters aren't going to die, and that strips certain shows of their jeopardy. We want there to be a feeling that anything is possible, and that going into the end of the series, that is very much true. There will be some surprising things.
It's the author-theodicy version of a point made by Augustine and Thomas Aquinas in sections of their work that I've taught in my history of philosophy intro class. Augustine asks us to consider a painting. There will likely be spots that, taken apart from the whole, would look ugly. But in the context of the whole painting they fit and make the painting itself more beautiful than it would be without them. Aquinas similarly says that the occurrences of evil in the world are indeed intrinsically bad. The fact that they occur is unfortunate, and other things being equal a good God who could prevent them would do so. But other things aren't equal, because the macroscopic picture of the history of the universe (which, of course, goes on forever into eternity according to Aquinas, with evil defeated forever after a certain point) is better as a whole if that evil occurs, even if the microscopic look at just that bit of evil should lead God to declare it bad and worth avoiding.
Lindelof seems to be making a similar point. It's unfortunate that these beloved characters had to die, but they thought things would be best for them to die at this point given the story they are trying to tell. The macroscopic look determines whether it's worth doing. They're not sorry they did it, because of that macroscopic effect. The microscopic look determines whether the event is unfortunate in itself, and in this case they admit that it is. But the macroscopic effect is what matters for storytelling, even if sometimes honesty requires acknowledging the microscopic picture as Lindelof does in this quote.