Reasons to kill a character:
– To advance the plot.
– To emphasize the theme.
– To motivate other characters.
– To fulfill the dying character’s personal goal.
– As recompense (karma, if you will) for the character’s previous actions.
– The character’s death is realistic or makes the story’s world realistic.
– To remove an unneeded character.
Reason NOT to kill a character:
– To upset audiences only for the sake of causing them grief or shock.
– To remove an unneeded character. (This can also be a valid reason, but if you need to kill them because they’re unneeded, please make sure that they really are needed in the first place. Just ask yourself: exactly what role does this character play in the plot, and can any other character(s) play this role for them?)
May not apply to huge sprawling dark fantasy novels, noire, or cyberpunk…