“And he shall not come upon the souls of a dead body; for his father and mother he shall not become impure!” (Vayikra 21:11)
It is a negative commandment that the high priest may not enter a dwelling with a corpse inside, even if it one of his closest relatives as it says “And he shall not come upon the souls of a dead body!”, which means to say that he should not be in a house together with them.
Amongst the roots of this commandment are that it is correct that the priests should distance themselves from anything remotely connected to impurity, as they are holy people who do the work of heaven constantly, and the high priest who is separated to be the highest level of holiness, even though he has a body, his soul will permanently rest with the angels, so the Torah never allowed him to become impure, even for those close relatives for which other Kohanim may become impure. This is because other Kohanim will become upset about their dead relatives, but the high priest, because he is so elevated will be completely separated from the natural ways of mankind, and will make himself forget all the ways of this temporary world, and he will not cry for the death of his relatives, for he is anyway separated from them even in this world.
This prohibition applies when the temple stood, and there is a high priest. It applies in any place, and even if the high priest leaves the holy land, the prohibition still applies.
It is a negative commandment that the high priest may not become impure even for a relative in any way that one receives impurity, whether it be through touching or carrying, as it says, “For his father and mother he shall not become impure!”, which means to say that he may not become impure even for his relatives. (This is not the same as the previous prohibition, as that referred only to impurity transferred through entering a dwelling place with a corpse inside, whereas in the current prohibition all other forms of receiving impurity have been added.)