Maran Rabbeinu Yosef Karo authored his epic Shulchan Aruch, the Jewish code of law, filled with all pertinent laws for every Jewish man and woman, based of the Talmud and Rishonim.
In general, Maran did not quote Agaddic texts or the reasons for the Mitzvot in his work and instead focused on the actual laws themselves. However, with regards to the Mitzvah of Sukkah, we find something interesting, in that Maran writes the following (in Chapter 625): “You shall dwell in booths for seven days, for I have made the children of Israel dwell in booths- this refers to the Clouds of Glory which Hashem surrounded the Jewish nation with so they would not be subject to the harsh heat and sun.”
This refers to a famous disagreement between Rabbi Eliezer and Rabbi Akiva (quoted in Sukkah 11b and Torat Kohanim, Parashat Emor) regarding what it means that Hashem had the Jewish nation dwell in “booths”. One sage maintains that this refers to actual booths and the Jewish nation built themselves booths as they sojourned through the desert. The other sage maintains that this actually refers to the Clouds of Glory which Hashem surrounded the Jewish nation with from all sides in the desert and these protected them from the heat and cold while also leveling the terrain for them.
Maran therefore rules that the Halacha follows the opinion that the “booths” were actually the Clouds of Glory and not actual booths. The Sukkot we make are in commemoration of these Clouds of Glory.
The question is: Why does Maran quote the reason behind this Mitzvah and of what halachic significance is it?
Maran Rabbeinu Ovadia Yosef zt”l explains in the name of the Poskim that Maran Ha’Shulchan Aruch wishes to tell us the appropriate intention one should have while sitting in the Sukkah. This follows the rule that “Mitzvot require intention” and thus, one must have intention to fulfill any Mitzvah one performs, such as donning Tefillin, kindling Shabbat candles, and the like, for if the not, the performance of the Mitzvah will be lacking.
Some say that regarding the Mitzvah of Sukkah that it is insufficient to think that one is sitting there “to fulfill the Mitzvah of Sukkah,” for the Torah explicitly states, “In order for your generations to know that I have made the children of Israel dwell in booths” and thus, one must also have in mind that the Sukkah commemorates the Clouds of Glory the Jewish nation was enveloped in when the traveled through the desert after they left Egypt. (Nevertheless, this intention regarding the Clouds of Glory is does not inhibit the Mitzvah, post facto. See Chazon Ovadia- Sukkot, page 95.)