Give the Villain a Hero's Funeral

He was evil, by the lights of the protagonist. But he was defeated, and now he's dead.

But he was famous, or he was in a highly-placed position, or somebody influential trusted him. If the general public finds out that he was a villain, then his family will suffer or his employers will go out of business.

There's no choice. So that innocent people do not suffer (or to protect the reputations of the people in charge, in more cynical works), the higher-ups have no option but to Give the Villain a Hero's Funeral. The protagonist is rarely happy with this decision... but usually understands why it had to be made.

This is a subtrope of both Never Speak Ill of the Dead and Treachery Cover-Up. Compare with The Power of Legacy, where people are mislead for the deceased's protection. Contrast with Redemption Equals Death, where the villain was no longer a villain when he died. If the villain is still alive but his superiors have ordered him to go get killed, that's Uriah Gambit.

Literature

 * The Apollo Murders: It wasn't until was told to make sure his story was straight before his trial that he realizes he was not only acting against NASA's interests but was also guilty of murder and treason. He drowns himself, but because of his high-visibility position in a program faced with massive budget cuts, NASA gives him a headstone at Arlington.