The registration of the Levites totaled 23,000, every male a month old or more; they were not numbered among the other Israelites, because no inheritance was given to them among the Israelites.
Levi was God's tribe, a tribe that was to have no inheritance with the rest in the land of Canaan, and therefore was not numbered with the rest, but by itself; so it had been numbered in the beginning of this book at Mount Sinai, and therefore came not under the sentence passed upon all that were then numbered, that none of them should enter...
Commenting on Numbers 26:57-62
twenty and three thousand--so that there was an increase of a thousand (Num 3:39). males from a month old and upward--(See on Num 3:14).
Num 26:62 The Levites were not mustered along with the rest of the tribes of Israel, because the mustering took place with especial reference to the conquest of Canaan, and the Levites were not to receive any territory as a tribe (see at Num 18:20).