The journey from Egypt to the Land of Israel could have taken just eleven days, but G-d took the Jewish People around the desert for forty years.
Eleven represents G-d’s Essence, which is higher than the ten Sefiros, the ten utterances with which G-d created the world and the Ten Commandments.
Forty years is the time that it takes to truly understand one’s teacher.
G-d’s intention was for His Essence (11) to become internalized (40) by the Jewish People, and for them to bring G-d’s Essence into the physical world.
(See talk of the Lubavitcher Rebbe King Moshiach Shlita, Beshalach 5752 (1992))