There must be a reason that the firstborn were targeted in the last of the 10 plagues before the Israelites escaped from Egypt. Were the other Egyptians more righteous? Why did the 10th plague target only those born first?
2 Answers
A few answers:
1) Shemos Rabbah 15:27 - It underscored the value of firstborns
The Torah writes (Shemos 4:22):
וְאָמַרְתָּ֖ אֶל־פַּרְעֹ֑ה כֹּ֚ה אָמַ֣ר ה' בְּנִ֥י בְכֹרִ֖י יִשְׂרָאֵֽל
Then you shall say to Pharaoh, ‘Thus says the LORD: Israel is My first-born son.
Hashem was showing Pharoah how much He values the concept of firstborns.
Like it writes in Devarim 15:19:
כָּֽל־הַבְּכ֡וֹר אֲשֶׁר֩ יִוָּלֵ֨ד בִּבְקָרְךָ֤ וּבְצֹֽאנְךָ֙ הַזָּכָ֔ר תַּקְדִּ֖ישׁ לַיהוָ֣ה אֱלֹהֶ֑יךָ לֹ֤א תַעֲבֹד֙ בִּבְכֹ֣ר שׁוֹרֶ֔ךָ וְלֹ֥א תָגֹ֖ז בְּכ֥וֹר צֹאנֶֽךָ
You shall consecrate to the LORD your God all male firstlings that are born in your herd and in your flock: you must not work your firstling ox or shear your firstling sheep.
As such, the Midrash concludes:
וְכָל מִי שֶׁהוּא עוֹבֵד בּוֹ לוֹקֶה, וְאַתָּה שָׁלַחְתָּ יָדְךָ בִּבְכוֹרִי, דִּין הוּא שֶׁתִּלְקֶה
And all who work it shall be lashed, and you who sent your hand against my firstborns, the law is that you shall be punished.
2) Yalkut Meam Loez (Shemos 12:29) - It was a case of midah knegged midah (measure for measure - M4M) - Pharoah bathed in the Jewish firstborn babies blood
When Pharoah was suffering with leprosy he would specifically slaughter the firstborns of the Jews and bathe in their blood.
בגלל פרעה שבהיותו מצורע היה שוחט בכורות ישראל כדי לרחוץ בדמם, והיה חושב בלבו להרוג את כל בכורות בני ישראל
Because of Pharaoh who, being a leper, would slaughter the firstborn of Israel to wash in their blood, and would think in his heart to kill all the firstborn of the children of Israel.
3) Malbim M4M - as the Egyptians worshipped the firstborn
באשר המצריים קדשו בכוריהם לע"ז ואז עשה ה' שפטים באלהי מצרים לכן המית הבכורים
Since the Egyptians sanctified their firstborns for idol worship, Hashem accordingly executed judgement on the gods of Egypt by killing the firstborns.
4) Abarbanel - It embodied all the evil that the Egyptians afflicted the Jews with
ולפי שהמצריים הרעו להם בכלל באה מכת בכוריהם שהיא כוללת בערך הרעה הכוללת שעשו להם בשעבודם
And according to the fact that the Egyptians did evil to them in general came the plague of their firstborn which it includes about the total evil that they did to them in their bondage
ואומרו כל בכור פירוש לא שתצא הנפש מהגוף לבד אלא שגם בחינת נפש תמות גוף ונפש של קליפת בכור מצרים. ואולי כי בזה לא נתעצם שום גלות עוד כבחינת גלות ושעבוד מצרים כי אבד כח הקליפה העצום שהוא בחינת בכור:
The meaning of ומת כל בכור is not simply that the soul of that person would die leaving the body as it had been, but the element which had made that person different from others because he was a firstborn would die with him. In other words there would never again be Egyptians (or even other Gentiles) whose characteristics would include elements of what had been known as the "firstborn" of the people beholden to the powers of the קליפה, the forces of negative virtues. Perhaps this is why no exile ever again assumed the dimensions of the exile in Egypt. G'd had weakened the powers of the קליפה permanently.
וראיתי לתת טעם למה לא יצאו ישראל אלא באמצעות מכת בכורות. עוד למה ה' הכה אפילו בכור שאינו מצרי דכתיב (לקמן י''ב כ''ט) בכור השבי. ואולי כי הטעם הוא לצד שמצינו שקרא ה' לישראל (לעיל ד' כ''ב) בני בכורי וכבר הודיענו רבותינו ז''ל (זהר ח''ב רס''ג) כי כל מה שברא ה' במדת הטוב גם זה לעומת זה עשה האלהים בבחינת הרע וכל בחינה ובחינה שיש בקדושה יש כנגדה בקליפה והקליפה מתאמצת ומתחזקת לאחוז בה, ולזה כנגד בחינת הבכורה שבקדושה היתה בחינת בכורה שבקליפה אוחזת ותוקפת בה לבל שלח עד אשר הרג ה' כל שם הבכורה שבקליפת מצרים בין של מצרים בין של האומות שהיו שם דכתיב עד בכור השבי ובכור השפחה וכל בכור בהמה, וגם בכור ישראל קדש אותם ה' כאומרו (במדבר ח' י''ז) כל בכור וגו' הקדשתי אותם לי כדי שלא תשאר בכורה זולת של קודש אשר הקדיש ה', ולזה מת אפילו בכור בהמה, וכיון שנעקר שם זה נפל ענף הרע שהיה מחזיק בבכור הקדושה ולזה תכף יצאו בני ישראל והגם שמצינו שיצאו ורדפו אחריהם, חשבו שעדיין יש בהם כח לאחוז בם, וצא ולמד מה עלתה בידם לא נותר בהם עד אחד:
I have tried to find a reason why the dying of the firstborn was a necessary prerequisite for the Exodus, as well as why even non-Egyptian firstborn (compare 12,29) had to die if they happened to be in Egypt on that fateful night. The reason is connected to G'd having described Israel as "My firstborn son" (4,22). We have a tradition (Zohar 2, page 263) that whenever G'd created some phenomenon which is clearly recognisable as something good, He also created its counterpart, i.e. something potentially evil at the same time. Every sacred phenomenon in our world is matched by a parallel phenomenon under the control of Satan, or what is known in Kabbalistic parlance "the forces of the קליפה." The latter make every effort to gain dominance over the former. We must therefore understand the forces of the קליפה which represented their firstborn as exerting every effort to frustrate the emigration of the Jewish people from Egypt. These efforts did not cease until G'd had "killed" the firstborn of the powers of the קליפה which opposed His will. What G'd had to do was to eliminate the concept of the firstborn being special, otherwise the relief as a result of the death of the Egyptian firstborn would have been only temporary. When the Torah (12,29) stresses that: "the firstborn of the captive, the firstborn of the maidservant and the firstborn of the animals died," this is in contrast to the firstborn of the Israelites who were subsequently sanctified (Numbers 8,17). The reason this sanctification of the Jewish firstborn became necessary is that G'd had done away with the concept of the firstborn being somebody special at the time He eliminated the firstborn on the night of the 15th of Nissan. Had this not been the case we would not understand why the firstborn of the animals had to die also. In Numbers 8,17 G'd declared that henceforth the firstborn of the Jews would be sacred to Him, i.e. there should no longer be a firstborn associated with the powers of the קליפה. If we find that the Egyptians still engaged in hot pursuit of the Israelites even after the death of the firstborn, this was because they had not yet realised that their former power had vanished. As a result, not a single one of them survived the debacle at the Sea of Reeds.