Why were the tribe of Levi not counted together with the other tribes?
Rashi #1: Because it is correct for the king's legion to be counted independently.
Rashi #2: Because Hashem foresaw that all those who were counted from twenty years and upwards were destined to die in the desert, so He precluded the Levi'im from that counting, 1 because, since they did not sin by the Eigel, they belonged to Him.
Rashbam: Because they were not conscripted to go to the army like the other tribes. 2
Seforno: Firstly, because they were not counted like all the other tribes; 3 Secondly, because they were singled out to perform the holy work in the Mishkan, and thirdly, because they alone, encamped around the Mishkan. 4