According to the baraita on our daf most of the offices in the Beit HaMikdash did not have mezuzot. The exception was the lishkat parhedrin, which, as we learned in the Mishna (2a) at the beginning of the massekhet, served as the residence of the High Priest during the week of preparations prior to Yom HaKippurim, thus obligating it in the mitzva of mezuza. Rabbi Yehuda argues that there were many offices in the Temple that served as residences, and did not have mezuzot. He claims that the mezuza on the door of the lishkat parhedrin was a special gezeira.
The Gemara asks why, according to Rabbi Yehuda, the offices in the Temple did not need mezuzot even if they served as residences. Rava suggests that Rabbi Yehuda demands that a house be built for use throughout the year in order for it to be obligated in a mezuza. Since the Temple residences were not used on a regular basis, they would not be obligated.
The Gemara does not ask a similar question on the Tanna Kamma’s position that only the lishkat parhedrin was obligated in the mitzva of mezuza. The Si’ah Yitzhak explains that the lishkat parhedrin was unique in that it was built to be the temporary home of the High Priest from the very beginning of its existence, obligating it in a mezuza. The other offices, even if they were occasionally used for one of the kohanim to stay overnight, were not built with that purpose in mind, so it was obvious in such cases that there was no obligation of mezuza.
The conclusion of the Gemara is that the difference between the Tanna Kamma and Rabbi Yehuda is based on a disagreement about dirah ba’al korhah – a house in which you live against your will. The Tanna Kamma believes that such a house is still obligated in mezuza, while Rabbi Yehuda rules that such dwelling place is not obligated in mezuza. Thus, the Kohen Gadol who lives in the lishkat parhedrin because of the mitzva, and not by his own free will, would not be obligated in mezuza according to Rabbi Yehuda – nor would other kohanim who live in the Temple offices. It is only to keep people from saying that the High Priest is kept in prison that a gezeira was made to put a mezuza on the door.