"Pinchas son of Elazar," and so forth. Why did Scripture see fit to give Pinchas a genealogy? Because they were disparaging him and saying, "Look at this son of Puti! The son of the daughters of Jethro, who was a priest of Midian, and whose maternal grandfather used to fatten calves for idolatry — and today he has become the prince of a tribe!" And from where do we know that his mother was of the daughters of Jethro? As it is said, "And Elazar son of Aaron took for himself a wife from the daughters of Putiel, and she bore him Pinchas" (Exodus 6:25). Therefore the Holy One, blessed be He, traces his lineage by the name of Aaron, and not by the name of Jethro.
Why Pinchas Is Traced to Aaron and Not to Jethro of Midian
Midrash Aggadah, Numbers 25:11
פנחס בן אלעזר וגו'. מה ראה ליחס לפנחס, לפי שהיו מבזין אותו ואומרים ראו בן פוטי זה, בן בנותיו של יתרו שהי' כהן מדין, והיה אבי אמו מפטם עגלים לע"ז, נשאר היום נשיא שבט, ומנין שהיתה אמו מבנות יתרו, שנאמר ואלעזר בן אהרן לקח לו מבנות פוטיאל לו לאשה ותלד לו את פנחס (שמות ו כה) לכך הקב"ה מיחסו על שם אהרן, לא על שם יתרו: