Our Gemara on Amud Aleph references the scripturally derived requirement that a Jewish king must be from a Jewish mother. Additionally, Tosefta Sanhedrin (4:6) requires the king to stem from kosher lineage, i.e. not from a forbidden sexual relationship.

Sefer Mish’an Mayim (Vayeshev), based on a Mizrachi, uses this idea to explain the quarrel between Yosef and his brothers. The verse states (Bereishis 37:8):

וַיֹּ֤אמְרוּ לוֹ֙ אֶחָ֔יו הֲמָלֹ֤ךְ תִּמְלֹךְ֙ עָלֵ֔ינוּ אִם־מָשׁ֥וֹל תִּמְשֹׁ֖ל בָּ֑נוּ וַיּוֹסִ֤פוּ עוֹד֙ שְׂנֹ֣א אֹת֔וֹ עַל־חֲלֹמֹתָ֖יו וְעַל־דְּבָרָֽיו׃

His brothers answered, “Do you mean to reign over us? Do you mean to rule over us?” And they hated him even more for his talk about his dreams.

There are two points of contention: Yosef’s words and his dreams. The Midrash explains regarding Yosef’s “words”: Yosef suspected his brothers of eating a limb taken from an animal while it was still alive (Eiver Min Hachai), and told his father about it (see Rashi on this verse and verse 2.)  The Mizrachi (ibid 37:2) explains this as stemming from a halachic argument.  Eiver Min Hachai has an odd leniency for a Jew over a gentile.  Since Shechitta for a Jew is a terminal point, once the animal is slaughtered though it still may be spasming, for a Jew it is no longer considered alive.  However, for a gentile, since slaughtering has no impact, the animal is alive as long as it is still thrashing about (see Chulin 102a-b). Thus, the Shevatim took a limb from a slaughtered animal while it was in its death throes.  Yosef considered it Eiver Min Hachai, because after all, they were still not real Jews yet.  However, the brothers, who adhered to the practice of slaughter, considered themselves Jewish and thus it was not Eiver Min Hachai.  

(I will add a chiddush of my own. Later, as the Viceroy of Egypt, Yosef commands that meat be slaughtered for the Shevatim as his guests (Bereishis 43:16). Possibly, Yosef was “dog whistling” them a concession, saying, “I agree. We are Jews and do shechitta.”:

וַיַּ֨רְא יוֹסֵ֣ף אִתָּם֮ אֶת־בִּנְיָמִין֒ וַיֹּ֙אמֶר֙ לַֽאֲשֶׁ֣ר עַל־בֵּית֔וֹ הָבֵ֥א אֶת־הָאֲנָשִׁ֖ים הַבָּ֑יְתָה וּטְבֹ֤חַ טֶ֙בַח֙ וְהָכֵ֔ן כִּ֥י אִתִּ֛י יֹאכְל֥וּ הָאֲנָשִׁ֖ים בַּֽצָּהֳרָֽיִם׃ 

When Yosef saw Binyamin with them he said to the one in charge of his house, Bring these men to the house. Slaughter an animal and prepare it, for these men shall dine with me at noon.)

In any case, building off of this interpretation, Mish’an Mayim says this was part of the Shevatim’s frustration regarding Yosef’s “words” and his “dreams”. His words of criticizing them for eating Eiver Min Hachai was based on his holding that they were considered as Gentiles, not Jews. But if so, how could he claim through his prophetic dream that he would be their leader and king?  They argued, if they were to be considered as Jews, then despite the fact that Rachel and Leah were sisters, since they “converted” to Judaism, they were effectively “born again” and no longer related (Shulchan Aruch YD 269:1). However, if Yosef was right, and they were to be considered halachically as Gentiles, then Leah, the first one married, was the legitimate wife. Rachel, on the other hand, was now in an illegitimate sinful relationship.  If so, Yosef, a child of Rachel should be ineligible for kingship.  (As per Tosefta Tosefta Sanhedrin (4:6), although notably, Tosafos Yevamos 45b “kiyvan” holds this disqualification is rabbinic, either Mish’an Mayim holds that the Shevatim kept to a rabbinic standard, or was aware of other opinions that the disqualification was intrinsic.)  The Shevatim were therefore aggrieved because of a combination of Yosef’s “words” and his “dreams”, as they were mutually contradictory.

The psychological point to consider is when did the Shevatim start seeing themselves as a nation, and not merely a clan or tribe? (See Chulin 101a-b, where this can also be seen as the subtext to the lomdishe discussions.)  I believe this is the story behind the story. Thus, when Shimon and Levi take revenge against the city of Shechem for raping and kidnapping Dinah, Yaakov was disturbed about how it would look to the ancient Mesopotamian United Nations (Bereishis 34:30):

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

Yaakov said to Shimon and Levi, You have made trouble for me, making me obnoxious to the inhabitants of the land, the Canaanites and the Perizzites. [Since] I am few in number, they will gather together and attack me. I and my house [family] will be destroyed.

However, the Shevatim’s response was that this was an act of war, and they responded on a national level. Their choice of words indicate this liminal point in self-development, as they transition in identity from a clan to a nation. Dare I say, this crisis actually was the catalyst for the transformation (Ibid 34:7), as crises often do induce change:

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

The Sons of Yaakov returned from the field when they heard [what had happened]. The men grieved and were very angry, for he [Shechem] had committed an outrage against Yisrael to lie with a daughter of Yaakov. Such a thing should not be done.

They start out as merely “Sons of Yaakov”, a clan, but their thinking evolves nationalistically, as they are “Israel”, and have been disgraced.

Nationalism is a rally point and inspiration, but also can lead to aggressive military action or oppression for the sake of maintaining a regime. Maase Avos Siman Le-Banim, what happened to the Patriarchs is a portent for their descendants.  Times will call upon Jews to act as a nation and protect itself, while they also need to know when nationalism can become idolatrous worship of the father-land.  My personal opinion is so long as hostages remain in captivity, Israel has every right to aggressively protect and even avenge itself.  God willing, when they succeed in rescuing all of them, difficult decisions will need to be made about when and how to scale down, and figure out what is humanitarian and what is foolish vulnerability.