Rabbi Hama bar Hanina said: What is the meaning of (Isaiah 43:9), "All the nations are gathered together"? In the time to come the Holy One, blessed be He, brings a Torah scroll and places it in His bosom, and says, "Whoever occupied himself with Torah, let him come and take his reward." Immediately all the nations gather together in confusion, as it is said, "All the nations are gathered together [etc.]." The Holy One, blessed be He, said to them, "Do not gather in confusion; rather, let every nation and its scribes [come], [as it is said] (ibid.), 'and let the peoples be assembled.'" The kingdom of Rome entered. The Holy One, blessed be He, said to them, "With what did you occupy yourselves?" They say, "We established many marketplaces, we built many bathhouses, and we multiplied silver and gold; all of it so that Israel could occupy themselves with Torah." He said to them, "Everything you did, you did for your own needs: marketplaces, to seat harlots in them; bathhouses, to pamper yourselves; the silver and gold are Mine, as it is said (Haggai 2:8), 'Mine is the silver and Mine is the gold.'" The kingdom of Persia entered. He said to them, "With what did you occupy yourselves?" They say, "We conquered many cities, we built many bridges, we waged many wars; all of it for the sake of Israel." He said to them, "Everything you did, you did for your own sake: cities, to impose forced labor in them; bridges, to collect tolls; as for wars, I waged them, as it is said (Exodus 15:3), 'The LORD is a man of war.' Is there any among you who declares this? as it is said (Isaiah 43:9), 'Who among them will declare this?' And 'this' is nothing but the Torah, as it is said (Deuteronomy 4:44), 'And this is the Torah which Moses set [before the children of Israel].'" They say before Him, "Did You give it to us and we did not accept it?" [Concerning them He says (Deuteronomy 33:2), "The LORD came from Sinai and shone forth from Seir upon them." This teaches that the Holy One, blessed be He, went around to all the nations of the world, and they did not accept it.] They say before Him, "Master of the Universe, give it to us anew and we will perform it." He said to them, "I will give you a minor commandment; if you observe it, I will give [you reward] like Israel." He said to them, "Go and make a sukkah." Immediately each and every one goes and makes himself a sukkah. And the Holy One, blessed be He, brings the sun out from its sheath, and each one kicks at his sukkah and goes out; as it is said (Psalms 2:3), "Let us tear off their bonds." And the Holy One, blessed be He, laughs at them, as it is said (ibid. 2:4), "He who sits in heaven laughs, the LORD mocks them."
The Nations Claim Their Reward and Reject the Sukkah
Midrash Tanchuma Buber, Shoftim 9:1
אמר ר' חמא בר חנינא מהו כל הגוים נקבצו יחדו (ישעיה מג ט), לעתיד לבא הקב"ה מביא ספר תורה, ומניחה בחיקו ואומר כל מי שעסק בתורה יבא ויטול שכרו, מיד מתקבצין כל האומות בערבוביא, שנאמר כל הגוים נקבצו יחדו [וגו'], א"ל הקב"ה אל תקבצו בערבוביא, אלא כל אומר וסופריה, [שנאמר] ויאספו לאומים (שם), נכנסה מלכות רומי, א"ל הקב"ה במה עסקתם, אומרים הרבה שווקים תיקננו, הרבה מרחצאות עשינו, וכסף וזהב הרבינו, הכל כדי שיעסקו ישראל בתורה, א"ל כל מה שעשיתם לצריכיכם עשיתם, שווקים להושיב בהם זונות, מרחצאות לעדן עצמכם, כסף וזהב שלי הוא, שנאמר לי הכסף ולי הזהב (חגי ב ח). נכנסה מלכות פרס, א"ל במה עסקתם, אומרים הרבה כרכים (תקיננו) [כבשנו] הרבה גשרים תיקננו, הרבה מלחמות [עשינו], הכל בשביל ישראל, א"ל כל מה שעשיתם בשביל עצמיכם עשיתם, כרכים לעשות בהם אנגריא, גשרים ליטול מכס, מלחמות אני עשיתי, שנאמר ה' איש מלחמה (שמות טו ג), כלום יש בכם מגיד זאת, שנאמר מי בהם יגיד זאת (ישעיה מג ט), ואין זאת אלא תורה, שנאמר וזאת התורה אשר שם משה (דברים ד מד), אומרים לפניו כלום נתת לנו ולא קבלנוה, [עליהם הוא אומר ה' מסיני בא וזרח משעיר למו (שם לג ב), מלמד שהחזיר הקב"ה על כל אומות העולם ולא קבלוה], אומרים לפניו רבש"ע תנה לנו מראש ונעשנה, א"ל מצוה קלה אני נותן לכם, אם אתם משמרין אותה אתן [לכם שכר] כישראל, א"ל לכו ועשו סוכה, מיד כל אחד ואחד הולך ועשה לו סוכה, והקב"ה מוציא חמה מנרתיקה וכל אחד מבעט בסוכתו ויוצא, נאמר ננתקה את מוסרותמו (שם ב ג). והקב"ה משחק עליהם, שנאמר יושב בשמים ישחק ה' ילעג למו (שם שם ד).