God’s instruction to Moses to take a census was clearly a means to prepare the Israelites for war (Numbers 1:2). Enlisted in the armies of Israel will be every male twenty years old and upward.
The tribe of Levi will be exempt from engaging in direct military conflict, as their duties lie with the tabernacle, so they are not to be included in this census (see Numbers 1:47).
2 “Take a census of all the congregation of the people of Israel, by clans, by fathers’ houses, according to the number of names, every male, head by head.