Bamidbar1:49

אַךְ אֶת־מַטֵּה לֵוִי לֹא תִפְקֹד וְאֶת־רֹאשָׁם לֹא תִשָּׂא בְּתוֹךְ בְּנֵי יִשְׂרָאֵל׃

"Only the tribe of Levi you shall not count, and you shall not take their total among the children of Israel.

Bamidbar 1:49

אַךְ אֶת־מַטֵּה לֵוִי

Bamidbar / Numbers 1:49

אַךְ אֶת־מַטֵּה לֵוִי לֹא תִפְקֹד וְאֶת־רֹאשָׁם לֹא תִשָּׂא בְּתוֹךְ בְּנֵי יִשְׂרָאֵל׃

"Only the tribe of Levi you shall not count, and you shall not take their total among the children of Israel.

Pshat פְּשָׁט

The King's legion

Rashi: the tribe of Levi is the King's legion, and it is fitting that it be counted on its own. And further: the Eternal saw that all those counted from twenty years were destined to die in the wilderness, and did not want the Levites, who did not err with the calf, to be among them. Sforno: the total of the tribe of Levi does not enter the general total of the tribes.

How Rashi and Sforno explain it

Remez רֶמֶז

Lifting the head

The midrash Lekach Tov: the Levites are not counted among the children of Israel, but their names are lifted to another greatness, to the service of the Mishkan. Kli Yakar: the word "only" excludes, and the words "take the total," "lift the head" everywhere speak of elevation: everything important and treasured has a number.

How Midrash Lekach Tov and Kli Yakar explain it

Drash דְּרָשׁ

Whoever drew a little near

The midrash explains: the Eternal saw that the people would anger Him and all those counted would die in the wilderness, and so He took the tribe of Levi out of that decree. The Levites drew near to Him when Moshe (Moses) called: "Whoever is for the Eternal, to me!", and whoever draws himself a little near is drawn very near. Whoever was tested and found faithful, the Holy One, blessed is He, trusts forever, like Yehoshua (Joshua), who defeated Amalek.

How Midrash Tanchuma (Buber) explain it

Sod סוֹד

A people of letters

Kedushat Levi teaches: the souls of Israel are the body of the Torah itself. Each one in Israel is a letter of the Torah, and when Moshe (Moses) counted the people, he was learning Torah. Israel matches the Torah given in writing, and the tribe of Levi the Torah passed on by mouth, so they are counted apart.

How Kedushat Levi explain it