The portion of Bamidbar — In the Desert — is always read right before the Holiday of Shavuot, when we received the Torah.
The giving of the Torah in the desert, not indoors, or in a garden or forest or city, is to teach us a lesson.
1) A desert belongs to everyone, it is not one person's or group's property.
The Torah too, belongs to every person, from a young baby to the elderly, regardless of how religious or not a person is.
2) A desert is bare, only earth fills it. Earth is low, reminds us of humility, not feeling "full of ourselves".
In order to learn Torah, and do G-d's will, one has to be humble. The sages say: "If a person wants to merit the Torah, he should put himself as a Desert!" — humble.
3) In a desert there lacks a person's basic necessities which are water, food and clothes. Nothing grows in the desert, it is barren.
When the Jews were in the desert they put their trust in G-d and relied on the righteous people who were with them. G-d gave them water in the merit of Miriam- Miriam's well.
The manna, which had all tastes, was in the merit of Moses, and the "Clouds of Glory" (among other miracles they did) washed and stretched the clothes of the Jews, so that it would fit the wearer. They were given in the merit of Aharon.
One should be like the Jews in the desert. One should study Torah, do the commandments, and put our trust in G-d to provide all our physical needs.
4) A desert is a dangerous place there are wild animals, snakes and scorpions that wander about. G-d chose such a place to give the Bible to teach us, that when a person connects himself with the Torah, the evil inclination who tries to hurt the Jew, cannot overcome him. The evil inclination, which tries to outsmart us, is compared to the dangerous snakes. The desert is compared to our time now, "Exile".
The Talmud states that in the Redemption, Moshiach will kill the evil inclination that will be the end to the spiritual and physical dangers. May it be now!