...Who Needs Enemies?

The hero is working to stop the plans of the Big Bad Evil Overlord, and has, at long last, found an ally. No, wait... perhaps ally is too strong a word. This person is fighting the Big Bad, just like the hero, but is doing so on their own terms with their own agenda. This agenda doesn't run contrary to the hero's, but at the same time the other person's agenda doesn't fall seamlessly in line with the hero's goals, either.

This so-called "ally" isn't overly concerned with the hero's welfare, or whether or not the hero succeeds in his mission. He or she isn't actively out to hurt the hero, it's just that they would happily betray the hero to the bad guy if it means that one of their schemes succeeded. But as long as the hero is of use to them, they'll help out when they can. They aren't necessarily malicious... they just have a mission of their own they are attending to.

Occasionally, the "ally" will actually be another villain, who, for some reason, has decided that helping the hero is beneficial to his own long-term goals. Often, this is part of a Xanatos Gambit; if they can use the hero to do some dangerous dirty work then why not? They either acomplish a goal or lose a potential enemy. It's win-win.

Expect the phrase "The enemy of my enemy is my friend" to be used, a sentiment that is quite often proven false in such situations.

Compare Divided We Fall where genuine allies fight, and contrast Enemy Mine where the above sentiment proves true. Not The Mole, but may as well be.

Anime & Manga

 * Sailors Uranus and Neptune in the "S" season (season 3) of Sailor Moon.
 * Xelloss of Slayers is the king of this trope. What's more, the Slayers know that he's only using them as part of a scheme to advance Mazoku interests, but between the facts that he's incredibly useful for the period of time where their goals coincide, and that they don't have any practical way of forcing him to leave, they have no choice but to put up with him.

Comic Books

 * In the Marvel Universe, Doctor Doom once agreed to assist the X-Men by successfully healing Shadowcat when she was about to die from the effects of a fight with the Marauders, after Reed Richards had tried and failed to do the same. Doom didn't actually give a damn whether Shadowcat lived or died... he just enjoyed the opportunity to show up Reed Richards.
 * In Sin City, Wallace gains the help of Corrupt Cop Liebowitcz who had previously been helping the Colonel, the head of an assassin guild. Despite Wallace beating up Liebowitcz's men several times and being a general annoyance, he agrees to help bring down the Colonel only because one of his assassins hurt his son.

Film

 * Hector Barbossa helped out Elizabeth Swann, Will Turner and Jack Sparrow in the later Pirates of the Caribbean films, but not because he liked them. More like Hector needed them to advance his own agenda.
 * In The Lord of the Rings: The Two Towers, the Ents help the people of the West by beating down Saruman not because they want to stop Sauron and destroy the ring (they specifically say that it's not their war), but because Saruman destroyed so many trees, and "A wizard should know better!"
 * In the first Alien vs. Predator film, Alexa Woods ends up teaming with the lone surviving Predator because she thinks it's the only way for her to get out of the situation alive (and she's right). The Predator's motive? He's still hunting the aliens, and hey, she proved herself useful in a fight and isn't an infected host so he may as well let her tag along if she wants to help him bag some more bugs.
 * In the second Blade film, the vampire hit squad teams up with Blade to stop the Reapers. They still don't like each other, and each side takes great pains to antagonize the other. And the moment they get the chance, the vampires betray Blade.

Literature

 * In Harry Turtledove's Worldwar series, the various combatants fighting each other in World War II abruptly stop fighting each other and all turn their attention to fighting the alien invaders. The fact that they are all cooperating (to various levels) to beat back an outside threat does not make them friends (or even, in some cases, allies).
 * When Griphook the goblin agrees to help Harry Potter break into Gringotts, he does so because he wants both to strike back at the human wizards who tortured him and to reclaim a lost goblin treasure and not because of any loyalty to Harry. Indeed, at his first opportunity, Griphook grabs what he wants and leaves Harry to escape on his own.
 * Basically every good faction in the Wheel of Time. Each of them has her agenda, and while all of them oppose the dark ones, some of these consider the other ones to be allies of the Big Bad, and everyone of these "know" better than the other how to stop the Big Bad. It's not always evident to know what if the most harmful between the Big Bad and the resulting struggles.

Live Action TV

 * Marya, the Russian spy from Hogan's Heroes.
 * In the Season Two finale of Buffy the Vampire Slayer, Spike helps Buffy stop Angel because he wants Drusilla to himself, and believes that with Angel out of the picture, he'll have a clear shot at her. He really couldn't care less if Angel ended up killing Buffy.
 * Later, after he'd been implanted with an inhibitor chip that prevented him from harming human beings, Spike helped the Scoobies fight demons simply because he liked to fight, and demons were the only things he could hurt anymore.
 * In the Star Trek: The Next Generation episode "Legacy", the Enterprise crew enlists the help of Ishara Yar in order to rescue a lifepod full of space-freighter crewmen from a hostile faction on the Death World Turkana V, only to find out in the end that Ishara Yar was using them as a covering force for her own mission: to blow up the fusion power plant belonging to that faction, so her own faction can gain supremacy.
 * In Deep Space Nine, the Romulans, Gorn, Tholians and Ferengi (all at least antagonistic toward the Federation and in some cases downright hostile) banded together with the Federation and Klingons (already long allied) in opposing the Dominion.
 * The Cardassians (and later the Breen) invert the trope, uniting with the Dominion to oppose the Federation and the Klingons.
 * Garak is this on a more personal level. A true patriot (like all good Cardassians), he was banished from his home but still loves Cardassia with all of his heart, and sees Dominion rule as disastrous. As such, he will do anything to destroy the Dominion, and for most of the series that means working with The Federation. His main differing point with The Federation is one of method, Garak has no qualms against any method that might achieve his ends. He has been willing to start wars, commit genocide, and manipulate, assassinate and be accessory to the creation of chemical weapons in order to destroy the Dominion. Worst of all, he makes a good case for it.
 * Section 31 may also count. While acting in the interest of The Federation, they are willing to violate each and every single one it's principles. The main characters of Deep Space Nine oppose them on the grounds that their methods are everything they are fighting against.
 * This was intended as part of the cast dynamic of Star Trek: Voyager, with the Starfleet and Maquis crew united only in getting home. Of course, the crews merge almost flawlessly and immediately, preventing this except for a rare few episodes.

Tabletop Games

 * Make no mistake, Human. We do not fight for your Emperor. We fight against Horus.

Video Games

 * In Jade Empire, Princess Lian starts out as this, but ends up joining your team and doing your bidding.
 * Morrigan of Dragon Age wants to stop the Blight just as the Warden does. . .but she also wants to
 * The sequel has
 * Lord Yuan and the Renegades in Tales of Symphonia, who fall into villainous territory because they feel Lloyd must be killed to guarantee their success, but whose aid is critical at several points in the story.
 * Volke from Fire Emblem Tellius is an assasin, thief and mercenary in every sense of the word. His motives are never explained and he only gives information for a fee. When asked why he always needs money, he asks for 100,000 in pay to answer.

Webcomics

 * Pretty much anytime Bun-Bun from Sluggy Freelance is "helpful," it's a case of this. Quite often a key part of the Main Characters' plans is to get Bun-Bun more pissed off at the bad guy than he is at them.
 * Indirectly referenced by one of the Seventy Maxims of Maximally Effective Mercenaries, from Schlock Mercenary: "The enemy of my enemy is my enemy's enemy. Nothing more, nothing less."

Western Animation

 * On Young Justice, Bane is willing to work with the Young Justice team in order to get his allies back. He winds up betraying them, though.
 * On Ralph Bakski's Terry Toons creation The Mighty Heroes, an apartment tenant and his neighbor see the destruction the Heroes are causing during a battle with an enemy and says "With heroes like these, who needs enemies?"
 * The Hair Bear Bunch episode "No Space Like Home" has Hair saying this about Bubi. Hair is made ruler of the planet Tarulia, but then Bubi—who speaks Tarulian (and any gobbledygook language) tells the natives that Peevly is their Earth leader. Hair is usurped for Peevly.

Real Life

 * The Soviets, the Americans and the British might have been allies against Germany in World War II, but that doesn't mean the Soviets were actually friends with the British and the Americans. There was of course a reason for that. What's more, it ultimately came to a head after WWII.
 * A similar thing happened with Finnland. They fought on the side of the Axis and managed to avoid being turned into a Soviet puppet.