One answer 1 is based on a Midrash 2, which expounds the verse: מי יתן טהור מטמא, who will bring out purity from the impure 3. The Midrash brings many examples of such a concept, such as Avraham, who was the son of the idol worshipping Terach, and King Chizkiyahu who was the son of the wicked Achaz. One example the Midrash gives is Mordechai, who descended from the sinner Shimi 4. This shows one of the strengths of Mordechai. Even though he came from an impure place, through his abilities he was able to become pure.
Where is such a concept hinted to in the Torah? According to the Rambam 5, among others 6, the mor dror. They translate it as “musk”, the congealed blood found in the throat of a well-known animal in India. It’s similar to a deer, one of its characteristics being that it’s free roaming 7. Even though the mor came from the blood of an impure animal, it ended up becoming one of the primary ingredients in the incense and anointing oil.
1 Chasam Sofer says this idea in Toras Moshe I to Exodus 30:23. However, he doesn’t cite the Midrash, which is the main justification for calling Shimi impure. The Chasam Sofer has another justification for this connection, as he calculates approximately five hundred years between Shimi and Mordechai, and the verse says the number five-hundred after mentioning the mor dror
2 Bamidbar Rabbah 19:1; Midrash Tanchuma Chukas § 4
3 Job 14:4
4 See II Samuel Chapter 16
5 Mishneh Torah Hilchos Klei HaMikdash 1:3
6 Rav Saadiah Gaon, Ibn Ezra, and Rabbeinu Bachaye ad. loc.; Abarbanel
7 Rabbeinu Bachaye loc. cit. See there for two explanations of dror