At the beginning of our parashah, God commands us to count the Children of Israel from twenty years old and upward. The question is well known: Does God not know the number of each of His creations, and surely the number of the Children of Israel; why is it necessary to count them? The holy book Shnei Lujot Habrit He responds as follows: the census serves to give the Jewish people particular importance, since something countable cannot be erased. The Jewish people are like "one sheep among seventy wolves," and there is a danger that, with the passing of generations, they will be erased among the other nations of the world. That is why God commanded the Jewish people to be counted so that the rule halakhic - Jewish legal - if it is "something accountable" it applies to them and cannot be nullified, thus remaining eternally.
According to this explanation, a big question arises: if the count gives the Jewish people special strength and importance, so that they are not annihilated among the nations of the world, would it have been appropriate to count them all Men and women, so that all may be "something countable"; why did God command only those over twenty years of age to be counted?
From this we learn that the strength the census gives to the Jewish people is specifically related to the task of those over twenty years old. This is also related to the festival of Shavuot, the time of the Giving of the Torah, since the parashah Bamidbar is read shortly before it and serves as preparation for it.
The main novelty of the Giving of the Torah is that it gave the Jewish people the power to unite the spiritual with the material, the boundless Divine holiness with this physical and limited world. Before the Giving of the Torah, it was impossible to sanctify physical objects and create a "holy object," since holiness could not be united with the material world. When God descended on Mount Sinai, this union between Divinity and the world was created.
That is why it was necessary for the Jewish people to be "countable." The Children of Israel are precious and important to God even without being counted; however, since the function of the Jewish people is to introduce Divine holiness into the worldly aspects of creation, it was necessary for the world itself, by its very nature and definition, to ensure that the Jewish people are "countable" and "not nullified." It follows from this that through counting, the Jewish people receive the strength to carry out their mission and make the world a dwelling place for God.
This task—of making a dwelling place for God in the world—begins for every Jew when he reaches the age of twenty. Before this age, a person's energies are focused on himself, on his work of self-improvement through Torah study. At the age of five, he begins to study Tanakh, at ten - Mishnah and then Gemara. Studying itself, at this stage of life, requires the person to give themselves completely and put aside their personal interests.
Only when a person reaches their twenties, when they begin to "pursue" their life, do they become a "soldier" to fight the war of world conquest, beginning to fulfill their role of making the material world a dwelling place for God. It is at this stage of life that a special strength is needed to carry out the mission; therefore, they are counted to become "something counted," so that the physical world "recognizes" their importance and allows them to carry out their task.
Extracted from Shulchan Shabbat