Revolver Ocelot in the MGS games, specifically MGS4. He may have recruited scores of psychopaths and misguided torture victims, personally and indirectly killed a lot of people, and sneered and snarked at Snake the whole way through, but he's ultimately doing the world a huge favor by waging his war against the Patriots. A brief societal collapse is a paltry price to pay for being freed of your insane, long-malfunctioning A.I. overlords.

The Shadowlord in Nier. (SPOILER)Dude's genuinely just trying to stop some out-of-control synthetic beings who think they're humans (sympathetic or not, regardless) from obliviously slaughtering the actual human race. He's the mostly unambiguous hero of the story. And for a guy whose life and identity have basically been stolen wholesale by his doppelganger, he's still remarkably calm and professional about what he has to do up until the player brings it all tumbling down toward the end.