The 2-0 win for the Polish side at Murrayfield on Wednesday was forfeited, and Celtic were awarded a 3-0 victory and will now meet NK Maribor of Slovenia later this month.
With the first leg in Warsaw having ended 4-1 for Legia, that made the aggregate 4-4 - and Celtic go through to today's Play-off Round draw under the away goal rule.
At a disciplinary meeting held at their headquarters in Switzerland today, Uefa found Legia had fielded Bartosz Bereszynski as a substitute for the final four minutes of the tie in Edinburgh when the defender was still serving a suspension.
Bereszynski was sent off in Legia's final Europa League game last season, against Apollon Limassol, and was handed a three-game ban.
Legia believed he had served the first two of these games when they eliminated Dublin club, St Pat's, in the second qualifying round of this season's competition.
And, having also sat out the first leg tie against Celtic, the Polish champions believed his suspension had been completed.
Celtic were not aware of the rule infringement, and did not make a protest.
However, a Swiss Uefa delegate, Paul Krahenbuhl, noticed that Bereszynski had not been included in the squad Legia registered with Uefa for the games against St Pat's.
And, under the competition rules, that meant these two games did not count towards serving his suspension.
Effectively, the clock did not start ticking on his Bereszynski's ban until he was included in their squad list, which he was for the ties against Celtic.
Legi's written representation argued that his four-minute involvement when they were five goals ahead on aggregate had no material effect on the result, and that it was down to a misinterpretation of the rules, not an attempt to gain an unfair advantage.
However, Uefa decided they were guilty of breaking their rules by fielding an ineligible player, and the automatic sanction for this is a 3-0 defeat.
Legia will now be included in today's draw for the play-off round of the Europa League, but chairman Dariusz Mioduski vowed to challenge Uefa's decision.
He wrote on Twitter: "Today, the sport lost behind closed doors. We made a mistake, sorry, but the penalty is disproportionate. Stay with us. We fight on."
It is the second time in three years that Celtic have profited from opponents breaking Uefa rules.
In 2011, Sion defeated the Parkhead club in the play-off round for the Europa League, but were subsequently found to have fielded five ineligible players who had been recruited by the Swiss club while they were still operating under a signing embargo for a previous rule infringement.