The Torah says:
You shall dwell in booths for seven days... so that your generations might know that I made the children of Israel dwell in booths. [Lev. 23:42-43]
The stated reason seems strange. It almost sounds like circular reasoning. Indeed, the Talmud, Midrashim and later commentaries say that the booths really refer to the clouds of glory God used to guide and shelter the people in the desert [Sifra, Emor 17:11; Mekhilta d'Rabbi Yishmael 12:35; Sukkah 11b]. These clouds are first mentioned in Exodus 13:21–22.
This also makes sense if we assume that God wanted future Jews to remember what He did for them during the Exodus from Egypt on all three pilgrimage festivals: On Pessah; the liberation from slavery in Egypt; on Shavuot, the giving of the Torah; and on Sukkot, the protection and sustenance during the trek in the desert.
Also, this is the only reference in the Torah to the Israelites actually dwelling in booths. Other references just mention the holiday and the four species.
Given all of the above, why do we celebrate Sukkot by building booths and dwelling in them?