“Except for his relative who is close to him… for his virgin sister… for her he will become impure!” (Vayikra 21:2-3)
It is a positive commandment that the Kohanim should become impure for the six close relatives enumerated in the Torah, when they die, as it says, “For her he will become impure!”. This is a positive commandment, that even if a Kohein is unwilling to become impure for a relative, we make him impure against his will. It once happened with a Kohein called Yosef, whose wife dies on the Eve of Passover, and he did not want to become impure, and the sages made him become impure against his will. The Rambam explains this commandment that it is part of the obligation to mourn for one’s six close relatives.
Amongst the roots of this commandment are that a person is affected by the actoions that he performs. This is because he is made of substance, he is not affected by potential unless he releases that potential into action. It follows that when a punishment happens to him and one of his close relatives (to whom he naturally has a close bond and love) dies, the Torah obligates him to perform actions which will awaken him to give his attention to the pain which has happened to him, and he will then know and think about the sins which caused that pain, for Hashem would never cause pain to a person unless he has sinned, and this is his complete faith. When a person realizes and considers this aspect of mourning, he will put his mind to repenting and he will correct his actions as much as he can.
This commandment that obligates a kohein to become impure applies to Kohanim at all times and in all places. However, it only applies to male Kohanim and not to females. The obligation to mourn, which is an extension of this commandment as explained above, applies at all times and in all places and to all people, whether Kohanim or regular people, male or female.