Unregistered defender Bartosz Bereszynski came on as a substitute with three minutes remaining in Legia's 2-0 win which sealed a 6-1 aggregate victory.
UEFA investigated the matter and awarded Celtic the match with a 3-0 victory, making the aggregate score 4-4 and sending the Scottish champions through on the away goals rule after they lost the first leg 4-1.
Celtic were handed a match with Slovenian champions Maribor in Friday's draw for the final round of qualification matches.
The games will be played 19/20 August and 26/27 August.
Dominik Ebebenge, sport department coordinator and head of development for the Polish club, said Legia would appeal against the decision.
"This is unjust and completely disproportionate," he told reporters at UEFA headquarters. "There have been similar cases in the past which have not punished in this way. This was just a basic human error.
"We have spent eight years working towards this and now it has been taken away from us. Financially, it's unimaginable and the players are shattered."
Bereszynski was sent off during last season's Europa League and was banned for three matches.
The fullback missed both Legia's second qualification round matches against Ireland's St Patrick's Athletic and the first leg against Celtic.
However, it was found that the club had not registered him for the games against St Patrick's, meaning the suspension had technically not been served.
It is the second time Celtic have been reinstated to the competition after opponents were found to have used ineligible players.
In the 2011-12 season, Swiss side Sion beat the Old Firm giants in the playoffs before falling foul of eligibility rules, having used five ineligible players.
Bereszynski, 22, has been suspended for one further European match for which he would otherwise be eligible, a punishment that will be added to the remaining two-match ban.
Teams Celtic can draw:
Maribor (Slovenia), Slovan Bratislava (Slovakia), Malmo (Sweden), Ludogrets Razgrad (Bulgaria) or Aalborg (Denmark)
- Sports & Recreation