"Happiness: Torah Style"
(יג) חַג הַסֻּכֹּת תַּעֲשֶׂה לְךָ שִׁבְעַת יָמִים בְּאָסְפְּךָ מִגָּרְנְךָ וּמִיִּקְבֶךָ. (יד) וְשָׂמַחְתָּ בְּחַגֶּךָ אַתָּה וּבִנְךָ וּבִתֶּךָ וְעַבְדְּךָ וַאֲמָתֶךָ וְהַלֵּוִי וְהַגֵּר וְהַיָּתוֹם וְהָאַלְמָנָה אֲשֶׁר בִּשְׁעָרֶיךָ. (טו) שִׁבְעַת יָמִים תָּחֹג לַיהוָה אֱלֹהֶיךָ בַּמָּקוֹם אֲשֶׁר יִבְחַר יְהוָה כִּי יְבָרֶכְךָ יְהוָה אֱלֹהֶיךָ בְּכֹל תְּבוּאָתְךָ וּבְכֹל מַעֲשֵׂה יָדֶיךָ וְהָיִיתָ אַךְ שָׂמֵחַ.
(13) Thou shalt keep the feast of tabernacles seven days, after that thou hast gathered in from thy threshing-floor and from thy winepress. (14) And thou shalt rejoice in thy feast, thou, and thy son, and thy daughter, and thy man-servant, and thy maid-servant, and the Levite, and the stranger, and the fatherless, and the widow, that are within thy gates. (15) Seven days shalt thou keep a feast unto the LORD thy God in the place which the LORD shall choose; because the LORD thy God shall bless thee in all thine increase, and in all the work of thy hands, and thou shalt be altogether joyful.
(יז) שבעת ימי הפסח ושמונת ימי החג עם שאר ימים טובים כולם אסורים בהספד ותענית. וחייב אדם להיות בהן שמח וטוב לב הוא ובניו ואשתו ובני בניו וכל הנלוים עליו שנאמר ושמחת בחגך וגו'. אף על פי שהשמחה האמורה כאן היא קרבן שלמים כמו שאנו מבארין בהלכות חגיגה יש בכלל אותה שמחה לשמוח הוא ובניו ובני ביתו כל אחד כראוי לו.

It is forbidden to fast or recite eulogies on the seven days of Pesach, the eight days of Sukkot, and the other holidays. On these days, a person is obligated to be happy and in good spirits; he, his children, his wife, the members of his household, and all those who depend on him, as [Deuteronomy 16:14] states: "And you shall rejoice in your festivals."

The "rejoicing" mentioned in the verse refers to sacrificing peace offerings, as will be explained in Hilchot Chaggigah. Nevertheless, included in [this charge to] rejoice is that he, his children, and the members of his household should rejoice, each one in a manner appropriate for him.

(יח) כיצד הקטנים נותן להם קליות ואגוזים ומגדנות. והנשים קונה להן בגדים ותכשיטין נאים כפי ממונו. והאנשים אוכלין בשר ושותין יין שאין שמחה אלא בבשר ואין שמחה אלא ביין. וכשהוא אוכל ושותה חייב להאכיל לגר ליתום ולאלמנה עם שאר העניים האמללים. אבל מי שנועל דלתות חצרו ואוכל ושותה הוא ובניו ואשתו ואינו מאכיל ומשקה לעניים ולמרי נפש אין זו שמחת מצוה אלא שמחת כריסו. ועל אלו נאמר זבחיהם כלחם אונים להם כל אוכליו יטמאו כי לחמם לנפשם. ושמחה כזו קלון היא להם שנאמר וזריתי פרש על פניכם פרש חגיכם.

What is implied? Children should be given roasted seeds, nuts, and sweets. For women, one should buy attractive clothes and jewelry according to one's financial capacity. Men should eat meat and drink wine, for there is no happiness without partaking of meat,nor is there happiness without partaking of wine.

When a person eats and drinks [in celebration of a holiday], he is obligated to feed converts, orphans, widows and others who are destitute and poor. In contrast, a person who locks the gates of his courtyard and eats and drinks with his children and his wife, without feeding the poor and the embittered, is [not indulging in] rejoicing associated with a mitzvah, but rather the rejoicing of his gut.

And with regard to such a person [the verse, Hoshea 9:4] is applied: "Their sacrifices will be like the bread of mourners, all that partake thereof shall become impure, for they [kept] their bread for themselves alone." This happiness is a disgrace for them, as [implied by Malachi 2:3]: "I will spread dung on your faces, the dung of your festival celebrations."

(יט) אע"פ שאכילה ושתייה במועדות בכלל מצות עשה. לא יהיה אוכל ושותה כל היום כולו. אלא כך היא הדת, בבקר משכימין כל העם לבתי כנסיות ולבתי מדרשות ומתפללין וקורין בתורה בענין היום וחוזרין לבתיהם ואוכלין, והולכין לבתי מדרשות קורין ושונין עד חצי היום, ואחר חצות היום מתפללין תפלת המנחה וחוזרין לבתיהן לאכול ולשתות שאר היום עד הלילה.

Although eating and drinking on the holidays are included in the positive commandment [to rejoice], one should not devote the entire day to food and drink. The following is the desired practice:

In the morning, the entire people should get up and attend the synagogues and the houses of study where they pray and read a portion of the Torah pertaining to the holiday. Afterwards, they should return home and eat. Then they should go to the house of study, where they read [from the Written Law] and review [the Oral Law] until noon.

After noon, they should recite the afternoon service and return home to eat and drink for the remainder of the day until nightfall.

(כ) כשאדם אוכל ושותה ושמח ברגל לא ימשך ביין ובשחוק וקלות ראש ויאמר שכל מי שיוסיף בזה ירבה במצות שמחה. שהשכרות והשחוק הרבה וקלות הראש אינה שמחה אלא הוללות וסכלות ולא נצטוינו על ההוללות והסכלות אלא על השמחה שיש בה עבודת יוצר הכל שנאמר תחת אשר לא עבדת את ה' אלהיך בשמחה ובטוב לבב מרב כל. הא למדת שהעבודה בשמחה. ואי אפשר לעבוד את השם לא מתוך שחוק ולא מתוך קלות ראש ולא מתוך שכרות.

When a person eats, drinks, and celebrates on a festival, he should not let himself become overly drawn to drinking wine, mirth, and levity, saying, "whoever indulges in these activities more is increasing [his observance of] the mitzvah of rejoicing." For drunkenness, profuse mirth, and levity are not rejoicing; they are frivolity and foolishness.

And we were not commanded to indulge in frivolity or foolishness, but rather in rejoicing that involves the service of the Creator of all existence. Thus, [Deuteronomy 28:47] states, "Because you did not serve God, Your Lord, with happiness and a glad heart with an abundance of prosperity." This teaches us that service [of God] involves joy. And it is impossible to serve God while in the midst of levity, frivolity, or drunkenness.

(יב) אף על פי שכל המועדות מצוה לשמוח בהן. בחג הסוכות היתה במקדש יום שמחה יתירה שנאמר ושמחתם לפני ה' אלהיכם שבעת ימים. וכיצד היו עושין ערב יום טוב הראשון היו מתקנין במקדש מקום לנשים מלמעלה ולאנשים מלמטה כדי שלא יתערבו אלו עם אלו. ומתחילין לשמוח ממוצאי יום טוב הראשון וכן בכל יום ויום מימי חולו של מועד מתחילין מאחר שיקריבו תמיד של בין הערבים לשמוח לשאר היום עם כל הלילה.

Even though it is a mitzvah to rejoice on all the festivals, there was an additional celebration in the Temple on the festival of Sukkot, as [Leviticus 23:40] commands: "And you shall rejoice before God, your Lord, for seven days."

What was done? On the eve of the first day of the festival, they would set up a place in the Temple where women [could watch] from above, and men from below, so they would not intermingle with each other.

The celebration would begin on the night after the first day of the festival. Similarly, on each day of Chol Hamo'ed, after offering the daily afternoon sacrifice, they would begin to celebrate for the rest of the day and throughout the night
(טו) השמחה שישמח אדם בעשיית המצוה ובאהבת האל שצוה בהן. עבודה גדולה היא. וכל המונע עצמו משמחה זו ראוי להפרע ממנו שנאמר תחת אשר לא עבדת את ה' אלהיך בשמחה ובטוב לבב. וכל המגיס דעתו וחולק כבוד לעצמו ומתכבד בעיניו במקומות אלו חוטא ושוטה. ועל זה הזהיר שלמה ואמר אל תתהדר לפני מלך. וכל המשפיל עצמו ומקל גופו במקומות אלו הוא הגדול המכובד העובד מאהבה. וכן דוד מלך ישראל אמר ונקלותי עוד מזאת והייתי שפל בעיני. ואין הגדולה והכבוד אלא לשמוח לפני ה' שנאמר והמלך דוד מפזז ומכרכר לפני ה' וגו': סליקו להו הלכות לולב, שבח לבוחן כליות ולב

The happiness with which a person should rejoice in the fulfillment of the mitzvot and the love of God who commanded them is a great service. Whoever holds himself back from this rejoicing is worthy of retribution, as [Deuteronomy 28:47] states: "...because you did not serve God, your Lord, with happiness and a glad heart."

Whoever holds himself proud, giving himself honor, and acts haughtily in such situations is a sinner and a fool. Concerning this, Solomon warned [Proverbs 28:10]: "Do not seek glory before the King."

[In contrast,] anyone who lowers himself and thinks lightly of his person in these situations is [truly] a great person, worthy of honor, who serves God out of love. Thus, David, King of Israel, declared [II Samuel 6:22]: "I will hold myself even more lightly esteemed than this and be humble in my eyes," because there is no greatness or honor other than celebrating before God, as [II Samuel 6:16] states: "King David was dancing wildly and whistling before God.
מגיד משנה הלכות שופר וסוכה ולולב פרק ח
הלכה טו
[טו] השמחה שישמח אדם בעשיית מצוה וכו'. דברי רבינו מבוארים בכ"מ בגמרא ובבמה מדליקין (שבת ל':) אמרו ושבחתי אני את השמחה זו שמחה של מצוה. ועיקר הדבר הוא שאין ראוי לו לאדם לעשות המצות מצד שהן חובה עליו והוא מוכרח ואנוס בעשייתן אלא חייב לעשותן והוא שמח בעשייתן ויעשה הטוב מצד שהוא טוב ויבחר באמת מצד שהוא אמת ויקל בעיניו טרחן ויבין כי לכך נוצר לשמש את קונו וכשהוא עושה מה שנברא בשבילו ישמח ויגיל לפי ששמחת שאר דברים תלוים בדברים בטלים שאינן קיימים אבל השמחה בעשיית המצות ובלמידת התורה והחכמה היא השמחה האמיתית. וזהו ששלמה בדרכי מוסרו שבח שמחת החכמה ואמר בני אם חכם לבך ישמח לבי גם אני:

Sefer Hachinuch
וכמו
כן מצות הלולב עם שלשת מיניו מזה השורש היא, לפי שימי החג הם ימי שמחה גדולה לישראל, כי הוא עת אסיפת התבואות ופירות האילן בבית, ואז ישמחו בני אדם שמחה רבה, ומפני כן נקרא חג האסיף, וצוה האל לעמו לעשות לפניו חג באותו העת, לזכותם להיות עיקר השמחה לשמו. ובהיות השמחה מושכת החומר הרבה ומשכחת ממנו יראת אלהים בעת ההיא, ציונו השם לקחת בין ידינו דברים המזכירים אותנו כי כל שמחת לבנו לשמו ולכבודו. והיה מרצונו להיות המזכיר מין המשמח, כמו שהעת עת שמחה, כי צדק כל אמרי פיו, וידוע מצד הטבע כי ארבעה המינין כולם משמחי לב רואיהם.

ועוד יש בארבעה מינין אלו ענין אחר, שהם דומים לאיברים שבאדם היקרים. שהאתרוג דומה ללב שהוא משכן השכל, לרמוז שיעבוד בוראו בשכלו. והלולב דומה לשדרה שהיא העיקר שבאדם, לרמוז שיישיר כל גופו לעבודתו ברוך הוא. וההדס דומה לעינים, לרמז שלא יתור אחר עיניו ביום שמחת לבו. והערבה דומה לשפתים, שבהן יגמור האדם כל מעשהו בדבור, לרמוז שישים רסן בפיו ויכוון דבריו, ויירא מהשם אף בעת השמחה.