Why would Admiral Piett allow a shuttle stolen by the Rebel Alliance to pass?
In Return of the Jedi, the Rebel Alliance use a stolen Lambda-Class Shuttle (Tydirium) to infiltrate the Imperial held moon Endor.
"We have stolen a small Imperial shuttle. Disguised as a cargo ship, and using a secret Imperial code, a strike team will land on the moon and deactivate the shield generator." ―General Crix Madine
It appears that the Imperials have some mechanism of identifying a ship. In Star Wars: Rebels, they are able to identify the Ghost rather than a generic VCX-100 light freighter.
Furthermore, we know the Admiral Correctly Identifies Tydirium:
"Shuttle Tydirium, what is your cargo and destination?" ―Admiral Firmus Piett
In canon, it is unclear whether the Empire was aware that Tydirium was stolen. (Legends there is a high speed pursuit ended with a Rogue Squadron rescue and a hyperspace jump).
I find it hard to believe that the Empire did not notice a valuable Lambda Class shuttle went missing; let alone, one carrying access codes to Endor. If Tydirium was reported as stolen by Rebels; why would they allow it to pass through to Endor:
Darth Vader: Do they have a code clearance?
Admiral Piett: It's an older code, sir, but it checks out. I was about to clear them.
There are a few explanations:
Admiral Piett was in on the Emperor's Plan
I do not see any evidence to support nor debunk this completely. Piett was given direct orders concerning the Rebel Fleet at Endor:
Admiral Piett: I have my orders from the Emperor himself. He has something special planned for them. We only need to keep them from escaping.
Admiral Piett had his own plan
There is no evidence to support this. My theory was that Piett saw the stolen shuttle and figured the Rebels would be easier to capture on Endor rather than while in space and still capable of jumping to hyperspace. His plan is put on hold when Vader tells Piett that HE would deal with them.
Admiral Piett: Shall I hold them?
Darth Vader: No. Leave them to me. I will deal with them myself.
The shuttle's status was not known
There is no evidence to say the canon Imperials knew that the shuttle was stolen. I find this hard to believe as the Lambda class shuttle was usually assigned to an officer or crew for high valued cargo/personnel. I also find it unlikely that a shuttle carrying secret Imperial codes to the Highly secure Endor Base/Death Star II would be left unchecked for more than a few hours. The codes being in Tydirium's computer is from Legends.