This week's parsha contains a rather unusual list of lineage in פרק ו. The list only goes until שבט לוי and it is very selective in which names it lists. The fact that the target of the list is שבט לוי is not surprising, for Moshe and Aharon come from לוי, and פסוקים כו-כז indicate the whole purpose of the list was to trace the ancestry of Moshe and Aharon. However, within שבט לוי, the particular names which the Torah decides to list are somewhat confusing. For example, the wives of Amram, Aharon, and Elazar are all mentioned, while the other men's wives are not mentioned. Another problem is that certain sons of Levi have more of their descendants mentioned in greater detail than others. How do we make sense out of all this?
The Rashbam and Da'at Zekenim MiBaalei HaTosafot explain that the Torah only pays attention to those people within Levi who will be mentioned later in חומש. The Ramban develops this further, stating that the entire genealogy list was designed to show respect to those who deserved it. Reuven and Shimon are mentioned before Levi, because the Torah wants to show them respect as Levi's older siblings. Within Levi, only Kehat has the details of his lineage described because no descendants of Gershon and Merari do anything significant that is worthy to be mentioned in חומש. The same holds true for Kehat's son Chevron, who had no descendants of note described in the Torah. Kehat's other sons, Amram, Yitzhar, and Uziel all had sons that played important roles in the Torah. Ramban adds that the reason that only Amram, Aharon, and Elazar had their wives mentioned is that only they had sons who were either נביאים or כהנים. This answer explains each specific case within the יחוס of mentioning somebody extra. However, there is one question that remains. Why is this list suddenly inserted here, after Moshe and Aharon have already made their first visits to Bnei Yisrael and Paroh?
There may be a deeper explanation for the list of יחוס which also explains what it's doing here. There is a prohibition against anointing a non-Jew as King of Israel based on the פסוק of לא תוכל לתת עליך איש נכרי אשר לא אחיך הוא (דברים יז:טו). Or HaChaim thus suggests that the Torah at this point wishes to trace Moshe and Aharon's ancestry to demonstrate that they are legitimate leaders of Bnei Yisrael. Moshe and Aharon just experienced their first discouragement. Paroh made Bnei Yisrael's lives more difficult. Consequently, when Moshe (who had been previously been believed by Bnei Yisrael) brought Bnei Yisrael Hashem's promises of redemption, the Torah states, ולא שמעו אל משה מקוצר רוח ומעבודה קשה, that the people's workload was too intense for them to believe in an impending salvation. Moshe now returns to Hashem and asks to not be sent to Paroh, because he feels he is inadequate because of his speech defect. Hashem again offers Aharon's assistance to Moshe, and He now wants to show that Moshe and Aharon are valid leaders. Moshe, in particular, may have been viewed as either a Midyanite or Egyptian, for he had not lived among Jews since he was three months old. He thus traces their lineage to prove that they are His chosen leaders. In fact, Ramban uses this idea to explain why the Torah identifies the wives of Amram, Aharon, and Elazar. Yocheved is mentioned to show that Moshe and Aharon's mother was a valid Jew and was (according to Chazal) blessed with giving birth to Moshe at age 031. Aharon's wife Elisheva is mentioned because she was the sister of Nachshon ben Aminadav, the Nasi of the tribe of Yehudah and progenitor of בית דוד. The Torah is stressing that Moshe and Aharon had a connection to royalty. Elazar's wife is identified as being a daughter of פוטיאל, who Chazal suggest was Yosef (see Rashi to ו:כה). At that time, Yosef was the only Jew who had served as a Minister in any government, so he was also a symbol of royalty. Accordingly, we can understand that the Torah wanted to show that, despite Moshe's concerns, he and Aharon were valid leaders.