On the seventh day, he shall shave all his hair… (Leviticus 14:9)
In the previous mitzvah, we discussed the purification process of the metzora. As part of that process, the metzora was shaved all over. At the end of the week following that purification process, he returned to the kohein and was shaved again.
The metzora is shaved all over with a razor, divesting him of all external hair. (The Talmud in Sotah 16b disabuses us of the notion that he would have to shave or otherwise remove his nasal hair.) After this second shaving, the metzora immerses and, after nightfall, he is completely cleansed.
It would seem that the reason to count this shaving as an independent mitzvah and not part of the previous mitzvah is because it is necessary to accomplish his purification. The process in the previous mitzvah gets the metzora to point A – he can re-enter the city but he still transmits a degree of impurity. The shaving is necessary to move the metzora from point A to point B – total purification.
The reason for this mitzvah is that the metzora has been given a clean slate, a new beginning. Symbolically, he is like an infant, with his whole life ahead of him. He has shed his baggage along with his hair.
This mitzvah applied to both men and women when there were kohanim who could diagnose tzara’as. The details of this mitzvah are discussed in the Mishna in the fourteenth chapter of tractate Negaim; in the Talmud, see tractate Sotah, pages 16a-b. This mitzvah is codified in the Mishneh Torah in the fourth chapter of Hilchos Mechusarei Kaparah and is #111 of the 248 positive mitzvos in the Rambam’s Sefer HaMitzvos.