מדרש אויף שמות 6:25

וְאֶלְעָזָ֨ר בֶּֽן־אַהֲרֹ֜ן לָקַֽח־ל֨וֹ מִבְּנ֤וֹת פּֽוּטִיאֵל֙ ל֣וֹ לְאִשָּׁ֔ה וַתֵּ֥לֶד ל֖וֹ אֶת־פִּֽינְחָ֑ס אֵ֗לֶּה רָאשֵׁ֛י אֲב֥וֹת הַלְוִיִּ֖ם לְמִשְׁפְּחֹתָֽם׃

און אֶלעָזָר דער זון פֿון אַהרֹנען האָט זיך גענומען אײנע פֿון די טעכטער פֿון פּוטיאֵלן זיך פֿאַר אַ װײַב; און זי האָט אים געבאָרן פּינחסן. דאָס זײַנען די הױפּטן פֿון די פֿאָטערהײַזער פֿון די לוִיִים לױט זײערע משפּחות.

Midrash Tanchuma

(Numb. 25:11) “Phinehas ben Elazar […].” What reason did the Holy One, blessed be He, have for tracing the lineage of Phinehas after this act (of slaying Zimri in Numb. 25:8)?1Numb. R. 21:3. [The reason was] that, when Zimri was pierced along with Cozbi, the tribes rose up against [Phinehas] and said, “Did you see the son (actually, grandson) of Puti? This man, whose mother's father2Thus Puti was actually Phinehas’ maternal grandfather, whose full name was Putiel. So Exod. 6:25. fattened calves for idolatry, has killed a tribal prince of Israel!” Therefore Scripture has come to trace his lineage [through his paternal grandfather] (in Numb. 25:11), “Phinehas the son of Eliezer, [who is] the son of Aaron the priest.” (Numb. 25:12:) “Therefore I hereby grant My covenant of peace.” Great is the peace that He gave, as the world only functions according to peace. And the Torah is [likewise] completely peace, as stated (Prov. 3:17), “Her ways are pleasant ways, and all her paths are peace.” If someone comes from a journey, we inquire of his peace (wellbeing). So too in the morning, we inquire of his peace, and in the evening we inquire of his peace. And we read the recital of the Shema and we conclude [its blessings] with peace, “who spreads the cover of peace.” And in prayer, we conclude, “Who blesses His people Israel with peace.” (Numb. 25:12:) “Therefore I hereby grant [My covenant of peace],” as he still survives. And so it says (in Mal. 2:5), “My covenant was with him, [a covenant of] life and peace.” (Numb. 25:13:) “And it shall belong to him and to his seed after him […, because he was zealous for his God] and atoned for the Children of Israel.” Since atonement is spoken of in connection with him, did he offer a sacrifice? [The mention of atonement is] simply to teach you that when anyone sheds the blood of the wicked, it is as if he had offered a sacrifice.
פֿרעגט אַ רבֿBookmarkShareCopy

Bamidbar Rabbah

“The children of Israel did in accordance with everything that the Lord commanded Moses, so they encamped according to their banners, and so they traveled, each according to his families, by his patrilineal house” (Numbers 2:34).
“The children of Israel did in accordance with everything that the Lord commanded Moses.” The banners are beloved before the Omnipresent, as He wrote in their regard: “As the Lord commanded Moses” (Numbers 2:33), just as it is written regarding the labor of the Tabernacle.
“So they encamped according to their banners, and so they traveled, each according to his families, by his patrilineal house.” The verse tells that immediately, Israel was swift to fulfill the word of the Omnipresent regarding the banners, and did not hesitate to perform it.
“The children of Israel did….” Where was Aaron? Rabbi Yehoshua bar Rabbi Neḥemya and Rabbi Levi bar Ḥayata in the name of Rabbi Ḥiyya bar Abba: When he came to establish their lineage, Israel said to him: ‘You are establishing our lineage? Before you come to establish our lineage, go and establish the lineage of Elazar your son. To whom is he married? Is it not to the daughter of Putiel?’ That is what is written: “Elazar, son of Aaron, took from the daughters of Putiel as a wife” (Exodus 6:25). When the Holy One blessed be He saw that they were disparaging him, He accorded precedence to the honor of Aaron relative to the honor of Moses. That is what is written: “These are the generations [toldot] of Aaron and Moses” (Numbers 3:1).
פֿרעגט אַ רבֿBookmarkShareCopy

Midrash Tanchuma Buber

Let us go back to the beginning of the section (i.e., to Numb. 25:10–11). What reason did the Holy One have for tracing the lineage of Phinehas after this act (of slaying Zimri in Numb. 25:8)?14Tanh., Numb. 8:1; Numb. R. 21:3. <The reason was> that, when Zimri ben Salu was pierced along with Cozbi bat Zur, the tribes rose up against him and said: Did you see ben Puti? This man, whose mother's father15Thus Puti was actually Phinehas’ maternal grandfather, whose full name was Putiel. So Exod. 6:25. fattened calves for star worship, has killed a tribal prince of Israel! Therefore Scripture has come to trace his lineage <through his paternal grandfather> (in Numb. 25:11): PHINEHAS BEN ELIEZER, BEN AARON THE PRIEST.
פֿרעגט אַ רבֿBookmarkShareCopy