Ace Attorney villains are really good at being moles, especially Matt Engarde who you'd think would be incapable of simply brushing his teeth without his manager, much less kill someone. Other examples include Calisto Yew aka Shih-na in the fifth game, and Kristoph Gavin who is the player's freaking boss in the fourth game.
The Detective Mole. Both of them. Byrne Faraday and Tyrell Badd worked together on the Yatagararasu case—and also were the Yatagarasu, together with Yew. And Luke Atmey, who claimed to be hunting Gentleman Thief Masque*Demasque while he was secretly the one funding and manipulating him. Starting to see a bit of a pattern here...
The Big Bad of Dual Destinies is one. It's another Detective Mole, Bobby Fulbright, who was actually killed and replaced by the Big Bad before the game even begins!
In Alpha Prime there is Coral Snake. Your first hint of them being the Mole is while watching a report from the villain requesting permission to terminate them because he no longer trusts them, and he later warns you not to trust them. The latter half of the game deals with the main characters accusing each other, finally leading the hero to wonder if the villain made up Coral Snake to turn the heroes against each other. He didn't. Coral Snake turns out to be Livia, who was working for the villain's superiors the whole time. Though she probably didn't have nice plans for the villain either.
In Alpha Protocol, Mina is a mole for the NSA, tasked with looking into the Alpha Protocol operation and bringing it down.
Oh, there's so much more than that: Parker is Halbech's mole within Alpha Protocol, Omen Deng is a Deep Cover Agent for Taiwan, Surkov is Halbech's real arms supplier in Russia, Scarlet is the assassin sent to kill President Sung, and it's heavily implied that Steven Heck was the one who set up the assassination plot in the first place. Plus there's all the traitors within the organizations you fight who are willing to sell you intel on their friends.
In Anachronox, the first person who joins your party, Grumpos is The Mole and has the symbol of the Dark Servents under his beard but it is not revealed until the final cutscene when he activates The Fountain Spiral to free the Dark Servents. The player generally suspects nothing, the only foreshadowing is when he refuses to go to Limbus, a planet which has experience with the Dark Servents and so would recognise him, but since he plays it as being afraid because of the place's reputation, it's not telling.
In Arcanum the Mole is immediately (and unnecessarily) lampshaded by The Lancer as soon as he offers to join. If you gather the right information to convince the leader of the entire organization to do a Heel-Face Turn, then he confesses and asks to remain in your party, otherwise he invites you to an ambush ("There's something I must tell you, but you must come alone! Otherwise the information will be Lost Forever!")
Baten Kaitos is an interesting case in that the mole is the main character, and you don't know until the second disc. He goes on to become The Dragon for a while until his defeat at the hands of his former friends, and then performs a genuine Heel Face Turn.
In Baldur's Gate II there is Yoshimo. He is forced to spy on you due to a curse Irenicus put on him. Interestingly enough if you kick him out of the party before you visit Spellhold and then visit him when you're done he'll die as soon as you come near him.
One of the endings in the Visual NovelBionic Heart creates a Detective Mole for the Big Bad. If you choose to free Tina and flee with Tanya without learning of Richard's whereabouts, it is revealed that Tina was already under Richard's control and is now his personal mole for the police.
Angel in Borderlands 2 is revealed to be a spy for Hyperion when the player plugs Wilhelm's power core into Sanctuary's defense systems and she uses it to lower the shields. She spends the next few chapters trying to apologize and convince the player that she's still their ally.
Scias from Breath of Fire IV. Though to be fair, he never was supposed to be on their side in the first place - apparently the party sort of forgot that he was the guard assigned to keep an eye on them.
Fortunately, Scias takes his orders literally. He was told to keep an eye on them, not to stop them from leaving the castle. He points this out to his employer, who, annoyed, has to agree that Scias fulfilled his contract. At which point Scias gives the money back when he has a case of Becoming the Mask.
In Carmen Sandiego Math Detective, you are the mole in the game's opening, infiltrating a VILE headquarters to learn about Carmen's latest scheme. However, you are exposed almost immediately and have to seal yourself in the room where Carmen's latest theft device is kept, using it as the Hub Level.
Carmen Sandiego: Well, well well. It seems we have an unexpected guest. Or should I say, an uninvited pest. Get the ACME Infiltrator!
The major subplot of the first Crusader game was that there was evidently a mole at the Resistance base. The character—and, in some cases, the player—didn't find out it was Major Vargas until one of the last missions of the game, at which point the damage had been done.
Dangan Ronpa and its sequel Super Dangan Ronpa 2 each have one, though both of them are played with. In the first game, it's Sakura Oogami, who is being blackmailed into being the mole, while the second game has Chiaki Nanami as the "traitor". However, both Nanami and the person she's working for (Usami) have the students' best interests at heart.
Deus Ex, being a pastiche of conspiracy theories, has a large number of moles, starting with the mole paramilitary group UNATCO, working for MJ12 and tycoon Bob Page working for himself. On a more personal level there's Harley Filben, working for the NSFUNATCO - or, more accurately: the IlluminatiMJ12 and Morgan Everett's mechanic, who places a bomb on Jock's helicopter.
In Diablo III, Adria turns out to be the high priestess of Diablo, with whom she conceived Leah for the sole purpose of being Diablo's vessel to be reborn as the Prime Evil.
In Duel Savior Destiny it becomes clear early on that the forces of Ruin have some sort of agent inside the academy, though their identity isn't uncovered until some time later. The mole, Downy Reed, almost acts offended when accused of being a traitor. After all, to be a traitor requires being on your side in the first place.
Ever17 has 'Takeshi' which is revealed in the final route. Minor subversion in that it was being done as part of a plan orchestrated by the good guys who simply couldn't tell anyone what was going on.
One side quest in Fallout: New Vegas involves exposing a Legion double agent posing as an NCR captain.
Front Mission loves this trope. Most of the PMO are ignorant of what goes on in Sakata Industries, being on the outside looking in. But there are those Moles who are well aware of such things, including President Koichi Sakata himself!
It is unclear which group Colonel Olson fits in.
Chairman Reiji Sakata, suspected as be The Mole, turns out to be the Reverse Mole who finally reveals his position upon learning that his own son is behind most of the evil.
In Lunar: The Silver Star, Nash eventually turns out to be a traitor who was working for Ghaleon, helping him spy on your every move. And depending on the version you played, Nash either turns out to be a double mole, or has a Sex Face Turn after the actions of another party member, Mia.
Mega Man 7: Bass/Forte only sought to steal the armor parts intended for Mega/Rock Man. The antagonism (nothing more than mere rivalry) of this Mole, however, becomes more openly displayed from then on. He's also just an occasional Punch Clock Villain, and the rivalry is put aside several times in many a temporary truce between the two as they unite against common menaces. Their final truce is implicitly permanent in Mega Man 10.
Mega Man X4's Double initially introduces himself to X during the Maverick Hunters' conflict with their sister organization Repliforce as a rookie Maverick Hunter. He is small, clumsy and chubby, and seems pretty harmless. He presents X the 8 Repliforce bosses and acts every bit X's ally, even pleading with him to not go fight Repliforce's Colonel. However, once X has taken care of them and heads to their space station Final Weapon, Double receives a transmission from Sigma to stop the Hunters from reaching Final Weapon at all costs, right in the middle of being teased by some of the Reploids in X's unit who were gearing up to follow X into space. He then proceeds to transform into his TRUE form... An ass kicking demonic looking bot with laser blades on the back of his hands. Turns out he is actually semi-made of liquid metal a-la T-1000, and able to change between his real form and a smaller innocent looking one. He then proceeds to slaughter every single one of the Hunters in the Hangar in probably the most graphic scene ever put in a Mega Man game. He then goes to Final Weapon himself, and intercepts X in his small form, bursting out laughing, claiming both the Hunters and Repliforce as idiots. He transforms, much to X's shock, as he had trusted his new ally, and attacks him. After he is defeated, he reveals had been sent as a spy from the very beginning to keep an eye on X.
In Mission: Impossible for the N64 and PS1, Ethan is framed for being Max's mole in the CIA halfway through the game, then later it is revealed that the real mole is Phelps, as in the movie.
In Neverwinter Nights, Desther Indelayne served under Lord Nasher Alagondar when Neverwinter was infested by the Wailing Death. He has the complete trust of the elven cleric Fenthick Moss and was rather suspicious of the player character's motives. After the 4 Waterdhavian reagents are recovered and a cure was created, Desther and his false Helmite priests steal the cure, revealing that they are serving the cult of the Old Ones who were behind the Wailing Death.
Reiko from Oneechanbara 2. She's an agent of an organization that joins Aya in her attempt to rescue her half-sister, Saki. Turns out said organization is evil, and she tagged along so that when Aya defeated the villain that had kidnapped Saki, Reiko could eat her heart and gain Baneful Blood powers. However, since this game only came out in Japan and the PAL territories, most US players only know this from the summary of the previous games included in the guides and manuals for the US-released Oneechanbara games.
In Persona3, Ikutsuki, who was The Mentor to the S.E.E.S. team, turns out to have been pulling their strings. Defeating the Bosses of each month, which he claimed would end the Dark Hour, instead brought about the end of the world as they knew it.
Jenkins is this in Red Faction: Guerrilla. He's a variation of this though, in that he's not really with the EDF, but is simply batshit insane.
In the first game, Hendrix is one of these for the player and the titular Red Faction. He works as Ultor's security technician, but secretly helps the Faction by providing them with information and hacking into Ultor's security systems.
In Renegade Ops, Natasha, the scientist you've been charged with protecting for the first seven missions, turns out to be working for the same faction as Inferno. Furthermore, she's actually Inferno's superior, sent down by her organization to watch over him after one screw-up too many.
Rescue on Fractalus! has aliens sometimes disguise themselves as human pilots, trying to trick you into "rescuing" them, only to kill you when you let your guard down.
Albert Wesker from Resident Evil. Since being outed and subsequently "killed off", he returned as a superhuman, badass villain.
Romancing SaGa Red Mage, who really is Spite; one of the Minions of Saruin; but if you saw Red Mages' clothes, the golden buckles on his front and the red coat with blueish-green hue on it is a dead give away since that quest is late in the game and you may have already fought Strife and Scorn who have a similar design other than Spite who took a human form.
Shining Force 2 had a blind, injured boy named Oddler who the party takes around with them for part of the game, and later turns out to be a greater devil named Odd Eye. Interestingly, he is a redeemable evil, as he sacrifices himself to pave the way to the Final Boss after the party defeats him in battle.
Sleeping Dogs revolves around the protagonist Wei Shen being an undercover policeman within the Sun On Yee, but so deep undercover that at one point his handler voices suspicions that he'd "gone native", not least since he'd ended up killing to "prove" that he's not an undercover, and by that point had killed many, many more.
A minor subplot has a minor character reveal his belief that Wei is a cop... except this guy is himself a police informant.
In StarCraft Brood War, Samir Duran helps the Terran forces at the early missions of the campaign. Halfway through the game, he manipulates the Terran Commander Gerard Dugalle that his childhood friend, Vice-Admiral Alexei Stukov was a traitor to the United Earth Directorate. Dugalle then gives Duran the mission to kill Stukov, after which Duran reveals himself as the real traitor and works with Sarah Kerrigan.
Then the trope is fulfilled again when Duran betrays Kerrigan at a critical hour, later revealing himself as "a servant of a far greater power" which will likely figure prominently in the sequel.
And now has.
In Strife it's revealed about mid-way through the game that Macil has a piece of the Sigil. He must be dealt with to finish the game but when you do so determines which ending you receive.
Sanchez, of Suikoden I, turns out to be a traitor. He pledges allegiance immediately when discovered, and, despite his hand in some horrific events from Odessa's death to sabotaging the Resistance's raid on the Empire's most important fortress, the hero doesn't execute him on the spot. He does spend the rest of his life in a prison though. Really, you should have known: he has a face portrait and hangs around you, but is not one of the 108 warriors.
Super Robot Wars: Original Generation has a variation on this. He's really in with the good guys, but he's mentally programmed by the bad guys so that he can't do anything that directly goes against them. So he made a female clone of himself that doesn't have the programming before he activated.
The sequel does this with a twist. The Shadow Mirrors sends Lamia Loveless a robot created by the Mad Scientist Lemon Browning, to act as a mole to spy on Kyosuke Nanbu. The player knows she's a mole right off the bat, and the drama is that Lamia is becoming self aware, and wonders if what she is doing is right.
Leon Magnus in Tales of Destiny is technically a mole, but since he was officially put in the group to keep an eye on them, it's not a secret to anyone.
In Tales of Symphonia, there are no less than three people spying from within the party at various points. First you have Kratos, who betrays you in the fake ending. Next, you have the Big Bad himself in disguise as a young boy, although at least he isn't an official party member. And finally, you have Zelos, who was spying on your party for both the Big BadandLa Résistance.
There's also Ricardo from Tales of Innocence. To be fair, he does have his own reasons, and doesn't take it well upon finding out what the Grigoris are about to do to the party. Man, the Tales series just loves this trope.
Alvin from Tales of Xillia. Unlike some of the other examples, he keeps playing both sides long after he's found out for the first time, only giving up on his ways towards the end of the game.
In Team Fortress 2, this is the point of the Spy. You disguise as a member of the enemy team, infiltrate headquarters, act like an ally... and then stab your "teammates" in the back as soon as you get the chance.
In The Elder Scrolls IV: Oblivion, several of the random citizens in Cyrodiil are actually Mythic Dawn cultists. Usually, you won't discover this until your actions make the Mythic Dawn faction sufficiently mad at you that they start to attack you on sight, although you may find this out ahead of time - say, if you burgle their house and find a set of cultist robes, or if they get attacked by something and blow their cover by summoning their trademark armor.
In Morrowind, The Nord leader of Vvardenfell's Fighter's Guild is revealed to be a Mole for the Cammona Tong, the Evil Counterpart to the regular Thieve's Guild that wants them dead. You can either help the Nord eradicate the Thieves' Guild, or help the second-in-command of the Fighter's Guild expose and kill him.
There's more than that, however. One Mages Guild quest requires you to root out a potential Telvanni spy; It's the Archmages personal assistant. A House Hlaalu quest has you delivering new orders to their spy watching their rivals House Redoran, the upper-class tailor in Ald'ruhn, the Redoran capital. Though one doesn't formally come up in the Thieves Guild questline, you can find a few Thieves Guild members deep undercover at the Camonna Tong HQ, the Dren Plantation. And then there is the player character, who (on the assumption that you eventually get around to doing the main quest) will be an undercover agent of the Emperor and member of a variable number of other factions (and if you choose to join the Temple beforehand, your involvement with the Dissident Priests and the Nerevarine Cult would also count).
From the manual for Wing Commander Privateer, the story of a station destroyed by Retros involves one, named Furstenburg, that shut down the station's defenses at a critical moment, allowing the Retros to attack unimpeded.