Study Yoma folio 11A with parallel Hebrew-English text, traditional commentary, and modern study tools. Free access to Babylonian Talmud online.
All the gates that were there on the east side of the Temple courtyard did not have a mezuza except for the Gate of Nicanor, as in the courtyard just inside the gate was the Chamber of Parhedrin, in which there is an obligation to affix a mezuza. Therefore, a mezuza was affixed to the gate as well.
Let us say that the baraita is in accordance with the opinion of the Rabbis and not in accordance with the opinion of R' Yehuda, as, if it were in accordance with the opinion of R' Yehuda, a difficulty arises. The principle is that decrees are issued only to prevent violation of a Torah prohibition
§ Apropos the mezuza in the High Priest’s chamber, the Talmud discusses other halakhot of mezuza. A baraita states with regard to the verse: “And you will write them upon the doorposts of your houses and upon your gates” (Deuteronomy 6:9): With regard to the gates of houses, and the gates of courtya
Abaye said to Rav Safra: If there is an obligation to affix a mezuza on city gates, with regard to those city gates [abbulei] of Meḥoza, a city with a Jewish majority, what is the reason that the rabbis did not affix a mezuza on them? Rav Safra said to him: Those gates are not the city gates. The
Rather, Abaye said: The reason that no mezuza was affixed there was due to the danger involved. The gates of a city populated by Jews certainly require a mezuza; however, since non-Jews live there as well, the danger is that the non-Jews would suspect the Jews of witchcraft or espionage, as it was