As we learned in the Mishna (2a) the High Priest is kept in one of the Temple offices for the week prior to Yom Kippur. Aside from training for the service that he is to perform on the Day of Atonement, this also keeps him away from his house, where there is a possibility that he may become ritually defiled by contact with others.
With regard to the sequestering of the High Priest, the Gemara asks: And before you remove him from the potential of impurity of his house, remove him from the potential of the more severe impurity imparted by a corpse. The Sages should have instituted an ordinance prohibiting visitors to the High Priest lest one die while in his chamber and render him impure.
The Gemara offers a variety of explanations why we do not totally limit his contact with others.
Rashi’s explanation of the Gemara’s question is that someone may enter his office in the Temple and die, so the suggestion is that contact with anyone should be limited. Some commentaries argue that Rashi’s explanation is difficult, both because the Talmud does not usually concern itself with the unlikely possibility that someone will die, and also because we know that the author of our Mishna specifically excluded that possibility, when he rejects Rabbi Yehuda’s opinion that we need to secure an additional wife for the Kohen Gadol lest his first wife pass away.
In explaining Rashi, the Gevurot Ari argues that we must distinguish between a situation where the question is whether a specific individual may die, and one where there is a group of people and the question is whether one person from amongst the group will pass away. Since many people visit the Kohen Gadol in his office in the week prior to Yom Kippur, the Gemara is within its rights to suggest that perhaps one of them will die.
There are those who suggest an alternative interpretation of the Gemara. Rabbenu Yehonatan argues that the Gemara is simply suggesting that we limit the High Priest’s contact with others, in case one of them is tameh met and will spread the defilement to others. According to the R”i ha-Lavan we move the Kohen Gadol to the Mikdash because he is much less likely to come into contact with the defilement of a dead body there, whereas at home the likelihood is much greater.