QUESTION: Should I kill an important good-guy secondary character?
It depends on what genre you are writing.
In romance a writer shouldn't kill off a favorite secondary character unless it's absolutely necessary. Romance is essentially the fantasy of happily ever after, and the death of a beloved character jars the reader's expectations.
If a nice character dies, it should be a noble death to save someone else's life, not a senseless death. The finest example of this is Sidney Carton in Dickens' TALE OF TWO CITIES who died so the love of his life and the love of her life could find happiness.
Science fiction, fantasy, and mystery have a harder edge, and readers are more willing to accept a character's death. In fact, if no one dies, many sf and fantasy readers consider that a flaw in believability.
I must admit to an intense dislike of having the major character's longtime love interest in a series killed, not only because I become attached to the character, but also because this is often writer laziness at its worst.
Usually, the love interest softens the major character, and the writer doesn't want any softness or mushy stuff. (Oh dear, someone might think I write those stupid romances so I'd better kill the love interest!) To bring the main character back to the way he or she was at the beginning of the series, the writer kills the love interest.
Of course, the most suicidal thing a writer can do in any genre novel is kill a beloved fictional pet or child. That will definitely drive readers away in droves.
As a good rule of thumb, I always try to remember an unspoken law in romance writing— “Never waste a perfectly good hunk.” In whatever genre you write, readers love sequels or new adventures with the secondary character as the hero.