Sefer Nechemia Ch. 8 - The Return of Sukkot
(יז) וַיַּֽעֲשׂ֣וּ כָֽל־הַ֠קָּהָל הַשָּׁבִ֨ים מִן־הַשְּׁבִ֥י ׀ סֻכּוֹת֮ וַיֵּשְׁב֣וּ בַסֻּכּוֹת֒ כִּ֣י לֹֽא־עָשׂ֡וּ מִימֵי֩ יֵשׁ֨וּעַ בִּן־נ֥וּן כֵּן֙ בְּנֵ֣י יִשְׂרָאֵ֔ל עַ֖ד הַיּ֣וֹם הַה֑וּא וַתְּהִ֥י שִׂמְחָ֖ה גְּדוֹלָ֥ה מְאֹֽד׃
(17) The whole community that returned from the captivity made booths and dwelt in the booths—the Israelites had not done so from the days of Joshua son of Nun to that day—and there was very great rejoicing.
(א) כי לא עשו מימי ישוע בן נון כן בני ישראל. ר''ל להיות לב כל הבאים שם טוב עם ה' ולקרוא יום ביום בספר תורת האלהים וידמה שכן עשו בימי יהושע בן נון לקרוא גם כן בספר תורת האלהים או יהיה שב אמרו כי לא עשו כן לעשות הסוכות ולב כלם לה':

“They did not do, etc.” Meaning, that the hearts of all who came there were good with Gd, and to read each day from the scroll of the Torah of Gd; it appears they did this in the days of Joshua ben Nun too, to read from the scroll of the Torah of Gd. Or, the reference of “they did not do” thus is to make Succot with their hearts all toward Gd.

ומ"ש בעזרא "ויעשו את חג הסכות" היינו בהלל ושמחה ועולות ראיה ושלמי חגיגה וד' מינים, הגם שלא קיימו אז מצות סוכה כראוי... ולפי סדר הכתובים דעה זו מחוורת יותר:

And when the book of Ezra says, “And they celebrated Succot,” it means with praise and joy and offerings and the four species, even though they did not fulfill Succah properly… And the flow of the text indicates that this view is more clearly correct.

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

Rama Orach Chaim 637 states that one may not place a succah in a public space. Since Jerusalem was not split among the tribes, it had no private space, just as one may not rent out a home in Jerusalem for the residents do not own them. Therefore, they could not make a succah there. And since in Ezra’s day they acquired Israel anew with chazakah and sanctified it, his court enacted that they may make succot in Jerusalem and other public areas, as stated in Tosefta Bava Kama 6 that a court-enacted condition permitted creating succot in public spaces. This means that Ezra’s court of that time enacted it, for otherwise they could not have created succot in Jerusalem…

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

54: Khazar: I did not see only that the people of the Second Temple had already forgotten the Torah, not knowing the mitzvah of Succah until they found it recorded… This demonstrates the loss of the Torah. 55: Habr: Then we today are wiser and more knowledgeable than they were; we know the entire Torah, as we think. 56: Khazar: That’s what I mean. 57: Habr: If we were instructed to bring korbanot today, would we know how to slaughter them, on what side… And what the kohanim were obligated to do in terms of holiness, purity, anointing…. 58: Khazar: We would not know, only from a kohen or prophet. 59, 61: Habr: But you see that the people of the Second Temple built an altar… One who knows all of these details of the Torah, could he not know how to make a succah… 62: Khazar: Then what is the meaning of “And they found recorded in the Torah.” 63: Habr: Clearly, it is because the recorder of the text was not sensitive to hidden matters, but only wrote that which was public and revealed. He did not record any of the wisdom Joshua received from Gd and Moshe, but he recorded the day the Jordan halted and the day the sun halted and the day of the [national] circumcision because they were publicized to the masses… For the intent of the text was to record only that which was known to the masses, which the entire nation carried, but the private matters held by individuals were lost from him, other than a minority of those matters… And so he did not record of the matters of Ezra and Nechemiah, only that which was known to the masses. And the day of making the succah was a public day, in the nation’s agitation and ascending to the mountains for olive leaves and myrtle leaves and date leaves and leaves of braided wood. And when it said, “And they found written,” it means the nation and masses heard and they were agitated, wanting to make succot. But individuals never lost an easy mitzvah, certainly a great one, and the text intended only to elevate that day…

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

Rabbi Shlomo ibn Aderet, Shu”t Rashba haChadashot miKtav Yad 367

The simple text shows that they did not know the mitzvah of succah, and of refraining from the Amoni and Moavi. But it is not so; rather, it is known that a nation cannot entirely follow the path of Torah, fulfilling all commands and avoiding all that the Torah prohibits, to the point that there will be no one who leaves the bounds of the Torah. Rather, some transgress knowingly out of compulsion from their desire, and some accidentally, not knowing or thinking - certainly, when they were exiled and they scattered here and there in their exile, and they encountered the trouble they encountered. And when they heard the Torah, they remembered what they remembered and repented, and one who had transgressed knowingly set his heart to regret it. This is why the Torah commanded to gather the entire nation – men, women, children, at the Sabbatical year… And so when Ezra read to them from the Torah scroll they saw what was commanded, and one who had not yet heard this contemplated it, and one who had known and transgressed knowingly, all of them were very agitated at this when they heard the words of the Torah… And it is known that from the days of Joshua, David and Solomon the Children of Israel did make succot, but not all of them did it as they did at this time, as I have said.