In addition to the reasons for sukka given above – commemorating the booths in the wilderness according to R. Akiva, and the clouds of glory according to R. Eliezer – residing in a sukka also reminds us of the Exodus from Egypt, as the verse states: “In order that future generations may know that I made the Israelites dwell in sukkot when I brought them out of the land of Egypt” (Vayikra 23:43). Not only Sukkot, but every Shabbat and holiday commemorates the Exodus from Egypt, as we acknowledge in kiddush and in our prayers. The Exodus is so important because the uniqueness of Israel, whom God chose as His treasured people and took out of Egypt, from bondage to freedom, was revealed through it. On a deeper level, He liberated our spirits from enslavement to materialism, for Egypt was a materialistic civilization. When we went free from Egypt, our spirits were freed from enslavement to the material, and we were free to accept the Torah (see Peninei Halakha: Pesaḥ 1:3).
It would seem that, if the sukka commemorates the Exodus, it should be built in the spring, the season when the Exodus took place. However, were we to build a sukka then, it would not be clear that it was to fulfill a mitzva, as during the spring there are people who sleep in booths or tents because they enjoy it. Therefore, we are commanded to reside in the sukka in the fall, to make it clear that we are doing so in order to fulfill a mitzva (Tur, OḤ 625).
Let us return to the debate between R. Eliezer and R. Akiva. The halakha follows R. Eliezer, which means that when we fulfill the mitzva, we must remember that the sukka is to commemorate the clouds of glory (SA 625:1). The Aḥaronim add that we must also keep in mind that the sukka is to commemorate the Exodus (MA; SAH; Pri Megadim; MB ad loc. 1). Some suggest that this is actually what R. Akiva meant – that we must remember the booths that Israel made when they left Egypt (Rabbeinu Ḥananel; Taz). Thus, if we recall both the clouds of glory and the Exodus, in practice we are following both opinions.
Although the reason for this mitzva is explicit in the Torah, as it states, “In order that future generations may know that I made the Israelites dwell in sukkot when I brought them out of the land of Egypt” (Vayikra 23:43), nevertheless, if one forgot to have in mind that the sukka commemorates the clouds of glory and the Exodus, he has fulfilled his obligation, as long as he intended to fulfill God’s commandment (Pri Megadim; MB 625:1; below, 3:3, we explain that this law pertains to the first night as well).