Well, if you consider the Templars to be the bad guys in the Assassins Creed games, then both AC III and AC:Rogue fit the bill. Though in 3 it's only for the first couple sequences and it's actually done kind of sneaky so you don't know that your character is a Templar until you're done with him. Rogue, OTOH, is more or less about an Assasin who gets pissed off at the Assasins and defects to the Templars, mostly because the Assassins are kind of being dicks, and then you go sail your pirate ship the North Atlantic ala Black Flag.
For one mission in CoD: Black Ops 2, you get to play as the Villain in a flashback.
Also, in CoD: Advanced Warfare, you work for the Bad guys for the first half the the game. You just don't realize they are the bad guys(Though being run by Kevin Spacey should have tipped you off).
I want to say Mass Effect 2, because you are working for Cerebus, which is a bonofide racist terrorist organization(Sorry, "Human Rights Movement") that commits war crimes. However, there is a Moral Choice system in ME series, and even though you have no choice but to do what the ILM says, you're never asked to do anything horrific. So I'm not sure if that counts.