The Bartimaeus Trilogy: Deadpan Snarker Bartimaeus does this constantly to Nathaniel; it is practically the basis of their relationship. Sadly, Nathaniel rarely seems to get the point. This is especially ironic because Bartimaeus is a borderline Noble Demon and Nathaniel is ostensibly the Kid with the Leash. It is open to interpretation whether Bartimaeus actually cares, or just gets his kicks seeing Nathaniel squirm.
In Bernard Cornwell's Saxon chronicles, the hero, Uhtred, spends the first couple of books as a violent, arrogant, murderous thug whose only real virtues are loyalty to his oaths and being one of the best fighters around. Halfway through the second book, a prostitute tells him exactly what she thinks of him, and he's forced into something of a personal re-evaluation. He doesn't stop being arrogant, murderous and unfaithful to his wife, but he does start to feel a little guilty about it.
In the Codex Alera series novel Captain's Fury, the First Lord has one of these when he awakens the Great Fury Kalarae prematurely causing the deaths of tens of thousands, to avoid tens of thousands of additional deaths. This provokes a What the Hell, Hero? from Amara and triggering that person's resignation.
Oddly enough, whenever Gaunt does go into a WTH, H moment (drinking, giving up, etc.), it is normally Rawne, one of the most morally grey characters of the series that sets him back on the straght and narrow. Normally by being an utterly Magnificent Bastard.
In Harry Potter and the Deathly Hallows, we learn that back before Dumbledore was a hero, he was about to abandon his mentally ill sister to go off with Gellert Grindelwald on a mad chase for power and glory when his brother called him on it. The ensuing fight, and its tragic consequences, led Dumbledore to rethink his path and ultimately become the nearly universally admired man he was.
Harry mentally applies this trope to his dad in Harry Potter and the Order of the Phoenix. After entering one of Snape's memories, Harry is appalled to see his teenage father casually attack and humiliate Snape for fun in front of a crowd of people (something Harry had experienced himself several times).
When Lupin decides to abandon his pregnant wife and unborn child (partly from fear and partly in order to protect them from the Fantastic Racism he experiences as a werewolf) and Harry, in a fit of anger, calls him a coward, says he's ashamed, and informs him that it's very much not what James would have wanted. Lupin, usually quite reasonable, comes to realize the error of his ways after a brief fit.
McGonagall to Harry, after he uses the Cruciatus curse, though that more calling him out for being in a building where everybody wants him dead.
Snape gives one memorable What the Hell, Hero? speech to Dumbledore, when Dumbledore reveals that Harry, whom Snape has been protecting out of his love for Harry's mother, must die in order to defeat Voldemort.
Dumbledore gives one of his own to Snape when he realizes that Snape is only worried about Lily being spared in Voldemort's attack and doesn't care if James and baby Harry are killed. Granted, he and James hated each other, but the murder of a baby doesn't seem to bug him as long as he gets a chance to comfort the widow.
In Warrior Cats, Foxleap's plan to save a group of a cats from a hawk goes wrong and one Tribe cat gets killed. One Tribe cat scolds him harshly for not listening when he was told to not interfere.
Also, Echosong did not approve of Leafstar driving Billystorm out of the gorge and had to spell it out for her.
In The Sun Trail, Clear Sky calls out Gray Wing for killing Fox...though HE was the one to tell Fox to attack him. Later, Gray Wing calls Clear Sky out for banishing Jagged Peak from the community and refusing to take in his son Thunder.
Pretty much every main character in Animorphs has had several of these. The one calling them out on it — mostly in a sober, thoughtful fashion — is usually one of their own, commonly Cassie.
Jake defeats the Yeerks with a truly magnificent What the Hell, Hero? sequence. Erek the android calls him on it before he even starts, but he does it anyway. One of the major steps in the sequence is when he flushes the Yeerk pool in the orbital spaceship into space, killing tens of thousands of Yeerks in one shot. After the war is over, he gets accused of war crimes during a trial. In addition, recruiting the auxiliary Animorphs in the first place, all of whom are handicapped children because the Animorphs knew the Yeerks wouldn't bother to infest them, got a What the Hell, Hero? out of Cassie's dad.
A slightly less serious example, but still in and of itself a What the Hell, Hero? moment is when Tobias is at a dance with Rachel, in his human morph, and she tries to trap him in it so they can have a normal relationship. Tobias doesn't exactly call her out on it, because part of him isn't entirely convinced she wasn't right.
Eragon then delivered his own What the Hell, Hero? to Sloan, calling him out for betraying his entire village to inhuman monsters whose primary diet consisted of humans as well as trusting them to keep their word when they kidnapped his "beloved daughter", who he ALSO sold out to them out of a petty grudge toward Eragon's cousin(who wished to marry her and wound up getting mauled by those abominations) as well as irrational superstition.
Remember he also murdered a night watchmen in order to rat out his village to the Ra'zac.
Later, Elva calls out Eragon for his actions (namely, trying to reverse the magic that he had just done, which got rid of Elva's compulsion to help those in pain) by comparing him to Gallbatorix. This seems to have more of an effect on him.
As with many, many things in the Inheritance Cycle, this is highly subjective. Especially the situation with Sloan. But one What the Hell, Hero? cannot be denied, and that is the nameless soldier in Feinster who calls out Eragon for helping to perpetuate a brutal war when the majority of the empire just wants to go about their lives.
Perhaps the best WTTH? in Inheritance is the poor soldier Eragon and Arya meet on their way back to the Varden. "Why are you doing this, you're a monster!" he screams as he surrenders. Eragon still murders him because "he was a threat"
In 1984, Winston Smith joins what he thinks is the resistance movement against "Big Brother." The supposed leader of the resistance, O'Brien, questions him on what he's willing to do for the movement. Smith agrees to everything O'Brien asks, including rape, murder, arson, terrorism, and even throwing sulfuric acid into an innocent child's face. Later on when it is revealed that O'Brien is a double agent working for Big Brother, he plays a tape of Smith confessing to this in order to destroy Smith's claims of moral superiority.
In The Malloreon, Garion gets a tongue-lashing from Belgarath after the thunderstorm he creates to stop the Mimbrate civil war ends up disrupting weather patterns across the continent, and is told that magic shouldn't be used so recklessly.
The Elenium features a scene where Sparhawk wants to go kill Krager before he can cause more trouble, and it given this reaction from Aphrael, pointing out that if Sparhawk goes to do this, then Ehlana is left vulnerable to attack.
Lampshaded in the Discworld novel Hogfather by Susan: "... and then Jack chopped down the beanstalk, adding murder and ecological vandalism to the theft, enticement and trespass charges already mentioned, but he got away with it and lived happily ever after without so much as a guilty twinge about what he had done. Which proves that you can be excused just about anything if you're a hero, because no one asks inconvenient questions."
In Jeff Long's The Descent, the bad guys (or one set of bad guys at any rate) are seeding the underworld with a deadly biological weapon to kill everything and later colonize it. Then at the novel's ending, the main character, who had been living with the degenerate troglodytes/demons for years, uses the dead Dragon's bioweapon trigger, effectively genociding most of them. Also doubles as Nice Job Breaking it Hero because the big bad (YMMV. The demon king, at any rate) survives, and is likely not happy about it.
The Star Wars Expanded Universe work Before the Storm had Luke being called out on, of all things, the destruction of the Death Star and the deaths of the million people onboard. Of course, Luke points out that the Death Star was a planet-killing superweapon.
To be fair, just prior to being chewed out Luke had essentially been bragging about being the one who fired the proton torpedo that blew up the Death Star. The "calling out" moment was as much a commentary about his slightly cavalier attitude toward killing.
In a later novel, Luke comments that "he has the blood of millions on his hands" despite the circumstances in which they died.
In Wraith Squadron, the Wraiths pull a prank that gets a cantina full of people to think that one of their female pilots is married to their Gammorrean pilot. Falynn is highly offended and doesn't find this funny, but then Piggy stops her, asks if she'd react like this if the prank had involved, say, Kell instead of him, and she immediately realizes that she's being speciesist, realizes that it is funny and apologizes, and they play along with what the cantina thinks, Holding Hands like young marrieds.
Karen Traviss's Republic Commando Series provide a chance for various characters to call this on the Jedi, the ostensible good guys of the Star Wars universe, for taking a conveniently provided army of 'living slaves' who have been 'torturously abused' since birth and using them as 'cannon fodder' for a war in which the soldiers have no stake.
Lucas Trask in Space Viking by H. Beam Piper has an internal one when he's talking with an eight-year-old princess and wonders how many of the people killed in his raids earlier in the book had been children.
The Army Suicide Prevention Interactive DVD has a moment like this - video clips show two soldiers and their families talking and the viewer chooses from options on what one soldier should do to help the other. Near the end, a choice comes up - "Physically restrain your friend and take him to a psychiatrist." Selecting this causes the Omniscient Narrator to say "Whoa! Really? Think about that for a second..." Followed by the main character placing his friend in a headlock and dragging him out of a mess hall while other soldiers look on, stunned.
In the third book of The Wheel of Time, Mat infiltrates the best-defended fortress in the world by himself to save the three female Action Girls. They basically kick dirt in his face as thanks. Several books later, a few other female characters call two of them on it and force them to apologize.
In the twelfth book, Rand balefires an entire friggin' castle in order to kill ONE (count 'em, ONE) of his enemies. And we never even see her body, so there's no proof it actually worked. It was at about this point other characters began to take a lot more notice of just how goddamn insane he'd gotten. Later in the same book he almost rains lightning down on an army of potential allies simply because they got highhanded (in such a way which invoked his irrational fear of being confined which had been caused a few books earlier) but manages to be talked down with another comment invoking this trope. Given Rand had access to destroy the world and was by this point overcome with paranoia, rage and schizophrenia, it is little wonder people waited until he was at the very limit before they really started calling him on such tendencies (which had been building for many books as his breakdown and psychosis developed).
Actually, there was evidence that it worked (Rand sent in a prisoner who was bewitched by said enemy, who went back to normal after the balefire hit) and it was mentioned several times that she broke the minds of her captives until there was no chance of recovery, so he saw it as a mercy kill. It's still pretty horrific, but at the end of it, a few of the heroes are actually wondering if the new, insane Rand actually has a point.
Evidence was incorrect. Book 13 confirms that Graendel survived. He did get Arangar, though, so it wasn't a total loss.
Worth noting, however, that Rand did all this using Balefire, a spell that destroys the fabric of reality. Using it can possibly be justified in small cases, but in the amounts he did...those who called him on it were almost certainly right to do so.
But any discussion of this grey morality was promptly thrown out the window since he got better
At the end of The Ethos Effect by L.E. Modesitt, Jr., the hero is forced to decide whether it is permissible to kill many people now so that more can live peacefully in the future. He decides that it is, and decides to commit genocide on the new would-be Evil Empire, before it can become a threat to the rest of the galaxy. Some extremely pacifistic Sufficiently Advanced Aliens call him out on this, accusing him of misusing their technology. He argues with them, saying that no, he's not a deity, just a tool-using creature who used the biggest hammer he could find because nothing else could possibly do the job, complaining that they're too afraid of corrupting themselves to take sides when humans fight each other.
In Emma by Jane Austen, Emma gets rebuked by Mr. Knightley because of her cruel behaviour to Miss Bates.
Patroclos, in the The Iliad, calls Achilles for moping over Briseis instead of fighting for Greece.
In Book 3 of the Aeneid, Aeneas and his men stop on an island and prepare for a meal, when a bunch of harpies come down and ruin the food (because that's what harpies do). So they prepare again, this time concealing weapons: when the harpies return, they attack. But not only are the harpies invulnerable (so the meal is still ruined), once they've flown to safety, one of them, Celaeno, gives a What the Hell, Hero speech, pointing out that the harpies were there first, and it's a little disproportionate to start a battle over some ruined food.
One of the Doctor Who Expanded Universe short-story collections had a tale with an AI that could recharge itself off emotions, attempting to get enough power to send a message and prevent the destruction of the planet it was on. In the end, it decided that the best solution was to call the Doctor out on some of his less pleasant actions - such as abandoning his daughter on a relatively barbaric world and inciting a race to war to find his lost pen.
A Song of Ice and Fire probably contains a couple, but first to mind is Sandor Clegane's deeply satisfying rebuttal to the accusations that the seemingly-oh-so-noble Brotherhood Without Banners lays against him. "I'm the same as you. The only difference is, I don't lie about what I am. So kill me, but don't call me a murderer while you stand there telling each other that your shit don't stink. You hear me?"
An earlier one is when Varys tells the imprisoned Ned Stark that his Honor Before Reason has caused a lot of damage that would have been avoided if he had simply chosen one of the several less honourable options he had been presented with.
Arianne and Doran Martell give this to each other after the former has nearly gotten an innocent girl killed and started a war in a scheme to claim her birthright, which she only started because the latter's apparent passivity and secretive nature gave her good reason to think she had to force the people of Dorne into action. The result of this reciprocal What-The-Hell-Hero-ing is that they mutually acknowledge their own faults, heal the breakdown of communications, and reconcile enough to work together.
The Acts of Caine are rife with this in all directions, given how nastily the Actors sent by the Studio act one they're on Overworld, and how much of a JERKASS Caine is. Notable ones in Blade of Tyshalle include the message sent by the dying primal regarding the HRVP infection, sections of Raithe's slow Breaking Speech to a captured Caine, and Caine and Kierendal ripping each other verbally after the HRVP outbreak in Ankhana. That last example is an interesting two-way example of this trope (Caine is the obvious protagonist, and Kierendal suspects she may be saving the Folk and the city from an Sociopathic Hero).
In A Series of Unfortunate Events, when the orphans are forced to burn down a hospital to survive, they wonder if they are really the "good guys" after all.
In The Wide Window, the orphans briefly give Aunt Josephine one when she offers to let Olaf have them if he wants, so long as he lets her live.
In a Crowning Moment Of Awesome, at the end of The Vile Village, Hector finally overcomes his fear of stuffed crow hats to call out the village elders for their horrible treatment of the orphans, pointing out that the children have had nothing but poor treatment since their parents died, that the village was called upon to take care of them, and instead they just used the children as cheap labor. Of course, the village elders are only "heroes" in the sense that they aren't affiliated with Olaf...
There's a moment at the end of Fool Moon, second novel of The Dresden Files, where he has to confront a pack of hexenwolves, or werewolves who use enchanted belts to change form. At this point, he's physically and magically exhausted. Having defeated one earlier and stolen his belt, he uses it, and becomes a raging monster. His wake-up call moment comes when he sees his reporter girlfriend, and she's terrified of him.
Actually this novel has quite a few What the Hell, Hero? moments, as far as Murphy's concerned.
In White Night, Murph calls out Harry when he lets his temper get the better of him and he flings a fireball at a building. As Murph points out, Dresdenverse magic can only be done when you truly believe in what you're doing. This fact is the wake-up call Harry needed to realize Lasciel's shadow was influencing him.
Earlier that year, in New Mexico, Ramírez tried the same. All he achieved was Harry's mercy, by execution, for the ghoul he'd been torturing. Harry himself remained cold and angry and terrifying.
Noticeably absent in Changes, when Harry agrees to become Queen Mab's Winter Knight. Everyone understands why he did what he did, and offer their moral support.
To be fair, there is one scene where it seems like his allies are about to give him one of these. But Harry cuts them short, saying that there isn't enough time to debate the ethics of his choices while his daughter is in danger.
To be more fair, Harry could probably cause much more pain and suffering if he is Mab's toy. Good thing he planned for that...
And to be even more fair, a substantial chunk of the next book, Ghost Story, features Harry mentally applying a What the Hell, Hero? to himself for the lines he crossed in Changes. The other characters don't really get to do it until Cold Days.
Harry also gives a few of these to Molly over the course of the series when she does something reckless, often when she's tried to once again Mind Rape someone despite being absolutely forbidden to do so (for extremely good reason) under pain of both her and Harry's deaths.
In Chekov's story in the Star Trek: The Original Series book Kobayashi Maru, he gets called out for his actions during a training exercise where the cadets are told the scenario is one where one of them was a traitor. Chekov's solution, which is what he imagines his hero, Captain Kirk, would do? Stun all the other cadets, including the ones who had allied with him, to make sure he wouldn't be taken out by the traitor. No cadet actually had been designated as a traitor; the exercise was to see how they dealt with a situation that could cause paranoia. (Kirk's solution had been to get everyone to cooperate.)
Mackenzie Calhoun from the Star Trek: New Frontier series got a doozy of speech from his first officer when he ran the Kobayashi Maru test when she disagreed with his solution: destory the Maru, on the basis that if the ship was a trap, the explosion would damage the Klingon ship and, it is was a genuine distress call, he would be saving the crew from torture and execution at the hands of the Klingons while buying his ship time to escape. Amusingly enough, the first officer also got a speech for failing to obey his orders during the test.
In Victory of Eagles, Captain Laurence is sent to take a group of dragons and interfere with French foragers, thus disrupting Napoleon's supply lines, and is told to "give no quarter", meaning that if any Frenchmen try to surrender...too bad. Eventually another character shows up and says, "Laurence, what are you doing?" Unusually optimistically for this trope, this is, in fact, enough to get Laurence to stop.
Joseph Rosenberger's ultra-violent COBRA novel series often has its "heroes" - a group of secret operatives - crossing the Moral Event Horizon for the sake of a mission. In one of the books a colleague challenges the team leader, Jon Skul, when Skul indicates that he needs to kill a police car full of cops in order to prevent them from interfering in a mission. Skul replies with a "put up or shut up" statement and proceeds to follow through with his plans.
In Death series: Eve got this from Peabody in Ceremony In Death and Witness In Death. It made Eve feel bad. Eve, on her part, got to pull some epic ones with Don Webster in Judgment In Death and Karen Stowe in Betrayal In Death.
Sisterhood Series by Fern Michaels: The book Payback had Jack giving Nikki this after suffering a No-Holds-Barred Beatdown from three men with gold shields sent by Charles. Shortly afterwards, Nikki gives one to Charles. In Sweet Revenge, Jack gives this to Nikki over the Vigilantes trying to get revenge on Rosemary Hershey by driving her literally insane!
The prominence of Black and Gray Morality in The Chronicles of Magravandias means that What the Hell, Hero? is almost the status quo of the series. The heroes of the story, such as they are, constantly disagree, do questionable to deplorable things, and argue with each other over who is less wrong.
Skulduggery Pleasant: Valkyrie gets this from Fletcher on a number of things in Death Bringer. It even makes her pause and consider her actions. For a moment.
No one is really happy with anything John does in Dirge for Prester John, and he is often called out for his prejudice. Even Hiob, several centuries later, judges John for falling away from Christian teaching.
Edilio Escobar is possibly better than anyone else at making Sam realize the implications of some of his actions, or inaction, as the case may be.
Qwill gives himself one at the end of The Cat Who Played Post Office. While his girlfriend Melinda is praising him for learning the truth about what happened to a missing servant girl, Qwill points out that by digging into the girl's disappearance, he caused those responsible for what happened to the girl to panic and kill three other women; if he'd stayed out of it, the killers would never have been brought to justice, but those women would still be alive.
In Star Trek: Articles of the Federation, President Bacco gives two of these speeches. The first is when she condemns the Federation Council for considering renewing trade agreements with Aligar, a culture whose exports are prepared by slave labourers - she later apologises for her behaviour. The second time, she points out the disturbing implications in the actions of Admiral Ross after the truth about his role in deposing President Zife comes to light. She notes that not only did he take it upon himself to remove the President from power, but in his public support for Bacco he also used his influence to encourage the ascension of a leader he personally preferred.
In Captain Vorpatril's Alliance, Simon Illyan, who is implicitly trusted by the Emperor, especially in matters of national security, conspires to help a group of foreigners steal priceless historical treasures, starting a course of events which results in the sinking of Imperial Security's headquarters. On finding out about this, more than one person's response is "What the hell, Simon?"
Cathy and Chris are constantly demanding this of each other in Flowers in the Attic. Cathy because Chris is so easily duped by their mother, who is keeping them locked up. And Chris because Cathy is extremely critical of their mother, who is the only person they can rely on to take care of them.
Luke calls Clary out (with good reason) at the beginning of City of Glass.
In The Land of Stories Carter calls the Fairy Council out on how they were punishing a fairy who lost her temper and turned the wings of another fairy who was teasing her into prune leaves for a few seconds (and how they were ready to banish her), but they weren’t doing anything about the Trolls and Goblins enslaving people. Though they don’t show their shame, they all admit that he’s right, and the fairy is pardoned.