This is a valid question, and not one that has a readily available answer. I think that the answer lies on a meta-level: the author George R R Martin (henceforth GRRM) initially expected A Song of Ice and Fire to be a trilogy, which means that the original major plot pieces and characters were set at an early stage. In this case, it is not all that strange that they should draw an ace from their sleeve at a late stage of the game: Aegon.
It is important to note that Varys & Illyrio did not set in motion the events that lead to the destruction of the Baratheon royal house -- that was Littlefinger. He murdered Jon Arryn, set the Starks against the Lannisters, thereby causing Cersei to kill off Robert. Varys and Illyrio has up until the end of ADWD refrained from too much outright assassination. In a sense, they have only profited from the chaos that Littlefinger has created.
In my opinion, it does not make sense to secretly support Viserys and Daenerys, while at the same time grooming Aegon as the real candidate. One might argue that Viserys makes for a good decoy, but then again, one could just as easily argue that keeping him alive also keeps the threat against house Targaryen alive. Viserys and Daenerys have been running all their lives, lived in fear and poverty. It is actually quite hard to expect that they should be grateful to Varys & Illyrio, should they eventually gain the throne. While they may harbour some positive feelings towards Illyrio for helping them with the Drogo alliance, they always thought of Varys as an enemy. And as Ser Jorah points out once to Daenerys, Illyrio sold Daenerys to Drogo.
What would happen, should Viserys make it to Westeros at the head of an army of Dothraki? Well, for one thing, as Ser Jorah (again) points out, nothing unites a kingdom like a foreign army invading: It would unite the supporters of house Baratheon. Dorne might still support Viserys, since Prince Doran hates Tywin Lannister, which would mean civil war.
We know that in ADWD:
Jon Connington and The Golden Company
did expect Viserys "at the head of an army of dothraki screamers". Although it does sound as though they expect him to be on their side.
Here, it seems to me that the logic is at an impasse: If Varys & Illyrio were to say: "Oh hay, king Viserys, meet king Aegon, your nephew, and -ahem- the rightful heir. We've been keeping him safe and grooming him to assume the throne you always thought was yours. Sorry about not keeping you safe during all those years by the way." -- which they almost would have to -- then Viserys would surely be furious. In any plan that involves both Aegon and Viserys to be alive and in charge of some army, it fails on that simple point: Varys & Illyrio have neglected and endangered Viserys and Daenerys for almost all their life, while they have been coddling Aegon. There is no way to mitigate or explain away this fact. So in essence, we have: If they want Aegon involved, then they would have to expect Viserys to be their enemy. And we know from ADWD that Illyrio did not really expect Daenerys to survive.
But as we know above, they expected Viserys and the army of dothraki on their side...? To me this seems like a crack in GRRM's logic. He started out with the rightful heirs on the run, and ended up with them clashing with the hidden claimant. Like I began to say, this is probably because the major plotline was intended for the much shorter time span of a trilogy. When drawn out and extended, it looks a lot more flawed.
One possibility that might tie everything together would be if we went back to what Jorah said about an invading army uniting the kingdom, and in passing take a quick glance at Stannis in ASOS, when he tells Samwell Tarly why he came to the Wall
“If not for my Hand, I might not have come at all. Lord Seaworth is a man of humble birth, but he reminded me of my duty, when all I could think of was my rights. I had the cart before the horse, Davos said. I was trying to win the throne to save the kingdom, when I should have been trying to save the kingdom to win the throne.”
When looking at the hard facts, Viserys and Aegon would have been competitors, and with the addition of Varys secretly supporting Viserys while neglecting and actively opposing Viserys as Robert's master of whisperers, they would be enemies. So Varys sets up Viserys to invade with a dothraki army, a young, arrogant and not well liked Targaryen. The kingdom unites against him, and war (and possible civil war) breaks out. Who should emerge at this time but king Aegon, who was not, after all, dead. He rides with quite esteemed allies (spoilers ADWD):
The Golden Company, returning in glory, Jon Connington -- Rhaegar's hand and friend -- and Septa Lemore aka Ashara Dayne and other incidental allies, such as Tyrion.
..to save the kingdom and defeat Viserys. As such, the plan would be masterful. Keeping Viserys alive would support Aegon being alive: If one Targaryen escaped, why not another? If they had instead been dead and gone all these years, it would be all that much harder to claim Aegon was the real deal. And what better way to come back to Westeros in style, than to rid the kingdom of the vengeful Viserys and his dothrakis?
Anyway, that is one thought one could have on this topic. It is a difficult obstacle to get past, that Varys & Illyrio supported both claimants to the throne. One thing that is clear, though, is that Aegon is the one they favour, the one they intend to rule. It is tempting to suspect a Blackfyre conspiracy here. For example:
- The Blackfyres have made a great many attempts to seize the throne before, but has been thought to have been finally stopped when Ser Barristan slew Maelys the Monstrous, ending the line of Blackfyre pretenders.
- The Golden Company's expressed goal is to reinstate a Blackfyre heir to the throne.
- Varys shaves his head, much like Egg, from the Dunk & Egg novellas. Could be to hide Targaryen coloured hair.
- Varys is from Lys, the same place Shiera Seastar came from, known lover of both of the brothers and enemies Brynden "Bloodraven" Rivers and Aegor "Bittersteel" Rivers -- the founder of The Golden Company.
We know that the Mad King Aerys II sent for Varys, because he was anxious about hidden enemies. Aerys finally was consumed by paranoia, by many accounts egged on by Varys "always pointing out new enemies", and finally Aerys' reign was ended. At this point, Varys could select any boy with the right look and claim it to be Aegon. If he is indeed related to Shiera Seastar, and an ally or relative of Bittersteel, he could pick a Blackfyre baby.
There are many tangible clues to the Blackfyre theory. But as of yet, it is premature to assume there is any merit to it. It is always fun to speculate, though.
One would have to wonder what revelations Bran will have in the upcoming The Winds of Winter, considering who his mentor is. Spoiler ADWD mystery:
Bran's mentor is Bloodraven, Maester Aemon's uncle and Bittersteel's brother