There is another midrash on Shemot 2:23,
|כג וַיְהִי בַיָּמִים הָרַבִּים הָהֵם, וַיָּמָת מֶלֶךְ מִצְרַיִם, וַיֵּאָנְחוּ בְנֵי-יִשְׂרָאֵל מִן-הָעֲבֹדָה, וַיִּזְעָקוּ; וַתַּעַל שַׁוְעָתָם אֶל-הָאֱלֹקִים, מִן-הָעֲבֹדָה.||23 And it came to pass in the course of those many days that the king of Egypt died; and the children of Israel sighed by reason of the bondage, and they cried, and their cry came up unto God by reason of the bondage.|
But why specifically leprosy? Well, a leper is considered as if dead, as in Moshe's prayer regarding his sister who had been struck with leprosy: (Bemidbar 12:11-12)
Divrei HaYamim 2, 26:21:
Yeshaya 6:1, which refers to the year of the death of Uzziyah, as in truth referring to the year in which he became a leper.
Also, Pharaoh (though an earlier one) in Bereishit 12:17:
|יז וַיְנַגַּע ה אֶת-פַּרְעֹה נְגָעִים גְּדֹלִים, וְאֶת-בֵּיתוֹ, עַל-דְּבַר שָׂרַי, אֵשֶׁת אַבְרָם.||17 And the LORD plagued Pharaoh and his house with great plagues because of Sarai Abram's wife.|
Still, I like to maintain that, quite often, every detail given by a midrash can be found in the psukim, and so I would also note that the phrase is וַיָּמָת מֶלֶךְ מִצְרַיִם. The midrash might be reading it as if the word was metzora'im, lepers, such that "the king died the death of lepers."