The portion of Bamidbar is always read before Shavuos, the festival of the giving of the Torah.1 One reason2 for this is to interpose a Torah portion between the admonishments found in Bechukosai and the giving of the Torah.

Another reason for reading Bamidbar before Shavuos is that the matters discussed in the portion directly relate to one’s preparations3 for receiving the Torah.

The general content of Bamidbar is the census taken during the second year of our sojourn in the desert. So important was this event that the entire fourth book of the Torah is known as the “Book of Counting.”4

The Midrash5 explains that G‑d commanded the Jews to be counted because they are of singular importance to Him: “They are likened to a mound of wheat. Just as wheat is counted before it enters the storehouse, so too G‑d commanded that the Jewish people be counted often.”

The Midrash must be better understood. A person counts his wheat in order to know exactly how much he has. G‑d, however, surely knew how many Jews there were without a census. Why then did He ask that they be counted?

The Shaloh explains6 that the very act of counting the Jewish people gave them importance and revealed their qualities; it made them “an object of numeration,” and the law is that “an object of numeration cannot become nullified.”7

But this too must be understood. The reason for the above law is because counting individual objects denotes their singular importance; they thus cannot be nullified. So it is not the counting itself that makes an object impervious to nullification. Rather, counting merely serves as an indicator that the object is truly important.

Since the Jewish people are worthy of being counted, being intrinsically an “object of numeration,” even if they had not been actually counted their importance would have endured. Why then was the count necessary?

The effect of Mattan Torah, G‑d’s giving of the Torah, was to connect the spiritual with the physical. Commandments performed up to that time did not sanctify the physical objects with which they were fulfilled.8 Mattan Torah empowered the Jewish people so that their performance of mitzvos would refine the physical world itself.

Since the Jews’ service following Mattan Torah made the world holy, it follows that the qualities of the Jewish people needed to be revealed in a way such that the world became cognizant of them.

If the importance of the Jewish people — revealed through their being counted — had remained in a spiritual state, they would nonetheless have retained their importance and not been nullified. But their power would have been limited to the service of G‑d as it related to them personally; they would not have been able to affect the world itself.

It was therefore necessary for the Jews to be actually counted, for their importance was thereby revealed in a way that was clearly perceived by the physical world. It then became possible for them to have a positive spiritual impact on the world as a whole.

This also explains the connection between the Torah portion of Bamidbar and the giving of the Torah:

By actually being counted, and thus having their importance revealed in a tangible manner, the Jewish people in turn were able to sanctify the entire world through their study of Torah and the performance of its precepts, transforming the world into a dwelling place for G‑d — the ultimate intent of Mattan Torah.

Based on Likkutei Sichos, Vol. IV, pp. 1019-1020.