When You our King, revealed Yourself upon Mount Sinai to teach Your people Torah and its precepts -- from the Rosh Hashanah Musaf Amidah
Why did G-d give the Torah while the Jews were still in the wilderness and not wait till after they arrived in the land of Israel?
The Talmud1 relates that Alexander the Great put forth ten questions to the elders of the South. One of the questions was "Were the heavens created first or the earth?" They replied, "Heaven was created first, as the Torah states, ‘In the beginning of G‑d’s creating the heavens and the earth.’"2
Why did Alexander want to know the order of creation?
As a great philosopher and a student of Aristotle, Alexander was understandably interested in the Jewish view of creation. However, the intent of his question here was much more profound. Alexander was the most powerful king of his times, and his goal of conquering the entire world was almost realized. Heaven represents spirituality and earth represents material pursuits. He was thus uncertain whether to emphasize physically acquiring as much of the world as possible or spiritually uplifting and enhancing the world already under his control.
Unable to decide on his own, he turned to our Sages for counsel. They responded that when G‑d created the world, He created heaven first, indicating that spiritual values are preeminent.
Therefore, G-d gave the Torah in the wilderness prior to the arrival of the Jews in their own land to emphasize the Torah’s superiority to land. The nations of the world who refused to accept the Torah became extinct with the loss of their lands. The Jews, however, exist forever, even without a land, as long as they keep the Torah.3