This mitzvah appears in the same verse as the previous one. Put together, they read, “Moses said to Aaraon and to his sons, Elazar and Itamar: Do not leave your heads untrimmed and do not tear your clothes so that you will not die...” The context is that Aaron’s other two sons, Nadav and Avihu, just brought an uncalled-for incense offering and perished. In response to this, Moshe is warning them not to do things that are normally signs of mourning because these things are prohibited for kohanim officiating in the Temple or, in this case, the Mishkan (Tabernacle). As with the prohibition on wildly-grown hair, the prohibition on torn clothes is repeated in parshas Emor among the laws of the Kohein Gadol (see Leviticus 21:10).
The Talmud in Horayos (12b) discusses what a regular kohein does, and what the Kohein Gadol does, upon hearing of the death of a close relative. It would appear that a Kohein Gadol does make a tear in his clothes as a sign of mourning, just in a more discreet location (according to one opinion, at the hem).
The reason underlying this mitzvah is the same as that underlying the prohibition on entering the Temple with unkempt hair: it’s a disgrace to the Temple to have unkempt kohanim walking around. And, as with the laws of unruly hair, it is prohibited for a kohein to enter the Temple with torn clothes, but he is only liable to the Heavenly death penalty if he serves in that condition.
In both of these mitzvos, the Ramban (Nachmanides) feels that only doing the service in an unkempt condition is forbidden by the Torah. According to his view, the prohibition on merely entering in that condition is of rabbinic origin.
This mitzvah applied to male kohanim in Temple times. It is discussed in the Talmud in tractate Horayos (12b). It is codified in the Mishneh Torah in the first chapter of Hilchos Biyas HaMikdash. It is #164 of the 365 negative mitzvos in the Rambam’s Sefer HaMitzvos.