Once Moses descended from Mount Sinai and saw the Israelites (and Aaron) dancing in front of the Golden Calf, he called upon the Levites to take vengeance upon the people. And so they did.
(כו) וַיַּעֲמֹ֤ד מֹשֶׁה֙ בְּשַׁ֣עַר הַֽמַּחֲנֶ֔ה וַיֹּ֕אמֶר מִ֥י לַיהֹוָ֖ה אֵלָ֑י וַיֵּאָסְפ֥וּ אֵלָ֖יו כׇּל־בְּנֵ֥י לֵוִֽי׃ (כז) וַיֹּ֣אמֶר לָהֶ֗ם כֹּֽה־אָמַ֤ר יְהֹוָה֙ אֱלֹהֵ֣י יִשְׂרָאֵ֔ל שִׂ֥ימוּ אִישׁ־חַרְבּ֖וֹ עַל־יְרֵכ֑וֹ עִבְר֨וּ וָשׁ֜וּבוּ מִשַּׁ֤עַר לָשַׁ֙עַר֙ בַּֽמַּחֲנֶ֔ה וְהִרְג֧וּ אִֽישׁ־אֶת־אָחִ֛יו וְאִ֥ישׁ אֶת־רֵעֵ֖הוּ וְאִ֥ישׁ אֶת־קְרֹבֽוֹ׃ (כח) וַיַּֽעֲשׂ֥וּ בְנֵֽי־לֵוִ֖י כִּדְבַ֣ר מֹשֶׁ֑ה וַיִּפֹּ֤ל מִן־הָעָם֙ בַּיּ֣וֹם הַה֔וּא כִּשְׁלֹ֥שֶׁת אַלְפֵ֖י אִֽישׁ׃ (כט) וַיֹּ֣אמֶר מֹשֶׁ֗ה מִלְא֨וּ יֶדְכֶ֤ם הַיּוֹם֙ לַֽיהֹוָ֔ה כִּ֛י אִ֥ישׁ בִּבְנ֖וֹ וּבְאָחִ֑יו וְלָתֵ֧ת עֲלֵיכֶ֛ם הַיּ֖וֹם בְּרָכָֽה׃
(26) Moses stood up in the gate of the camp and said, “Whoever is for the LORD, come here!” And all the Levites rallied to him. (27) He said to them, “Thus says the LORD, the God of Israel: Each of you put sword on thigh, go back and forth from gate to gate throughout the camp, and slay brother, neighbor, and kin.” (28) The Levites did as Moses had bidden; and some three thousand of the people fell that day. (29) And Moses said, “Dedicate yourselves to the LORD this day—for each of you has been against son and brother—that He may bestow a blessing upon you today.”
But this is not the only time that the Levites slaughtered people. Let's start with Genesis and move forward.
These verses conclude the story of the Rape of Dinah. Shimon and Levi murdered the men of Shechem while they were recovering from their circumcisions as an act of revenge. Notably, they took Canaanite women as booty.
When Jacob lay dying, he cursed Shimon and Levi. Note that the Tribe of Shimon disappears; the Tribe of Levi become the priests and attendants - but they hold no property in Eretz Yisrael. Keep that in mind as we progress through this tale.
(ה) שִׁמְע֥וֹן וְלֵוִ֖י אַחִ֑ים כְּלֵ֥י חָמָ֖ס מְכֵרֹתֵיהֶֽם׃ (ו) בְּסֹדָם֙ אַל־תָּבֹ֣א נַפְשִׁ֔י בִּקְהָלָ֖ם אַל־תֵּחַ֣ד כְּבֹדִ֑י כִּ֤י בְאַפָּם֙ הָ֣רְגוּ אִ֔ישׁ וּבִרְצֹנָ֖ם עִקְּרוּ־שֽׁוֹר׃ (ז) אָר֤וּר אַפָּם֙ כִּ֣י עָ֔ז וְעֶבְרָתָ֖ם כִּ֣י קָשָׁ֑תָה אֲחַלְּקֵ֣ם בְּיַעֲקֹ֔ב וַאֲפִיצֵ֖ם בְּיִשְׂרָאֵֽל׃ {פ}
My might and first fruit of my vigor,
Exceeding in rank
And exceeding in honor. (4) Unstable as water, you shall excel no longer;
For when you mounted your father’s bed,
You brought disgrace—my couch he mounted! (5) Simeon and Levi are a pair;
Their weapons are tools of lawlessness. (6) Let not my person be included in their council,
Let not my being be counted in their assembly.
For when angry they slay men,
And when pleased they maim oxen. (7) Cursed be their anger so fierce,
And their wrath so relentless.
I will divide them in Jacob,
Scatter them in Israel.
Here is a story that you know. Now, read it again, knowing that Moses was a Levite.
(14) Thus you shall set the Levites apart from the Israelites, and the Levites shall be Mine.
The Levites are to have no share of the land. In fact, they are dependent upon tithes for their sustenance. This "iniquity": is it, as Rashi says, a threat that they will be held responsible if an Israelite approaches the Tabernacle? Or is it due to their warlike nature?
(י) וַיְדַבֵּ֥ר יְהֹוָ֖ה אֶל־מֹשֶׁ֥ה לֵּאמֹֽר׃ (יא) פִּֽינְחָ֨ס בֶּן־אֶלְעָזָ֜ר בֶּן־אַהֲרֹ֣ן הַכֹּהֵ֗ן הֵשִׁ֤יב אֶת־חֲמָתִי֙ מֵעַ֣ל בְּנֵֽי־יִשְׂרָאֵ֔ל בְּקַנְא֥וֹ אֶת־קִנְאָתִ֖י בְּתוֹכָ֑ם וְלֹא־כִלִּ֥יתִי אֶת־בְּנֵֽי־יִשְׂרָאֵ֖ל בְּקִנְאָתִֽי׃ (יב) לָכֵ֖ן אֱמֹ֑ר הִנְנִ֨י נֹתֵ֥ן ל֛וֹ אֶת־בְּרִיתִ֖י שָׁלֽוֹם׃ (יג) וְהָ֤יְתָה לּוֹ֙ וּלְזַרְע֣וֹ אַחֲרָ֔יו בְּרִ֖ית כְּהֻנַּ֣ת עוֹלָ֑ם תַּ֗חַת אֲשֶׁ֤ר קִנֵּא֙ לֵֽאלֹהָ֔יו וַיְכַפֵּ֖ר עַל־בְּנֵ֥י יִשְׂרָאֵֽל׃
Note the warlike blessing that Moses gave the Levites. The Baal HaTurim, a medieval commentary, smoothed over Levitical history by saying that the Levites went from being a warlike tribe to a tribe of teachers. They were to teach Torah to the people. I think that the warlike nature of the Levites still was an issue when this poem was composed.
While I Chronicles is perhaps a later text, it clearly paints the Davidic Monarchy in the most positive light. Saying that the Levites are the sole people to carry the Ark shows the primacy of the Tribe of Levi during the time of King David.
(23) The word of the LORD came to Jeremiah: (24) You see what this people said: “The two families which the LORD chose have now been rejected by Him.” Thus they despise My people, and regard them as no longer a nation.-a
Let Your Thummim and Urim
Be with Your faithful one,
Whom You tested at Massah,
Challenged at the waters of Meribah; (9) Who said of his father and mother,
“I consider them not.”
His brothers he disregarded,
Ignored his own children.
Your precepts alone they observed,
And kept Your covenant. (10) They shall teach Your laws to Jacob
And Your instructions to Israel.
They shall offer You incense to savor-e
And whole-offerings on Your altar. (11) Bless, O LORD, his substance,
And favor his undertakings.
Smite the loins of his foes;
Let his enemies rise no more.
And nothing perverse was on his lips;
He served Me with complete loyalty
And held the many back from iniquity.