For a genre often associated with beloved heroes like Sailor Moon or Goku, anime often makes their protagonists commit horrible atrocities. Unlike anime that follow villains, anime with complicated heroes do not necessarily set out to create sympathetic characters; some of these "heroes" are just not great people.
Some anime heroes who did something bad have one or two minor transgressions on their rap sheet. Joey Wheeler of Yu-Gi-Oh! tormented Yugi for about two episodes, but he gets his act together and becomes a good friend. Other morally ambiguous anime good guys commit more serious misdeeds, ones that can be hard to overlook. Guts of Berserk slays hundreds of people, eventually betraying a person he loves in one of the most egregious ways possible.
Anime protagonists who do terrible things can sometimes be hard to root for, but sometimes their actions serve to tell something larger about the storyline. However, that only provides justification for a few of these immoral anime heroes.
No matter how nuanced and well-developed Shinji Ikari becomes over the course of Evangelion, it's hard to overlook the moment he pleasures himself over Asuka's comatose body. Yes, you read that right; meek, little Shinji actually does that.
Though he's motivated less by total depravity and more by profound loneliness and desperation, he still totally disrespects his friend in one of the most disgusting ways possible.
Guts often uses his formidable strength to save others from various dangers including despotic power-hungry priests to literal demons, but his rap sheet is long and horrible. First of all, he slays hundreds, if not thousands, of people, including children, under a staggering variety of circumstances. Though he doesn't enjoy it, he'll do it out of necessity, and in the world of Berserk, necessity is often observed.
Though technically a hero, Guts will unleash his cruelty on the ones he loves. One of the worst things he ever does is sexually assault Casca, the love of his life. Thanks to traumatic events, including repeated rapes, Casca's mind is already nearly destroyed, and she can no longer speak, reason, or look after herself. Though Guts wants desperately to protect her, he still assaults her. He immediately begins feeling remorse and self-loathing, but nothing ever erases what he's done.
Lelouch Lamperouge's ultimate goal involves taking down the Holy Britannian Empire and freeing the Japanese people from its tyranny. To do this, he must take out a lot of people. None of the slayings are exactly good, but one of the saddest is when he must end the life of Euphemia, his half-sister. Despite being part of the royal family, Euphemia supports the Japanese people and wants to create a safe zone where they may live without being oppressed by Britannia. However, Lelouch accidentally uses his Geass power to set her on a path which would end in the Japanese people being slain en masse.
The only way to prevent that outcome is to end her, so he does exactly that. It's a particularly tragic moment because Euphemia wants to do the right thing, and Lelouch is the one who accidentally sets her on the wrong path through mind control.
When the title character in Battle Angel Alita first runs into Yugo, both she and the audience get the sense of his heart - his earnestness and courage - as he attempts to protect Alita while facing insurmountable odds. She takes an immediate shine to Yugo, unrepentantly crushing on him and even working to help him reach his goal of 10 million chips, which he almost delusionally believes will buy his way out of Scrapyard, up into the rarefied air of Zalem.
His profound desire to reach Zalem is the crux of Yugo's problem and the motivation for his least savory actions. For one thing, he takes advantage of Alita's naivete, accepting her assistance while ignoring her feelings, blinded by his quest. For another thing, before meeting Alita, he racked up credits by aggressively fighting and paralyzing unsuspecting cyborgs, stealing their spinal columns, and selling them to the highest bidder.