Our rabbis say: it was because they fed their eyes on the Shekhinah. They said: Did not Moses do thus, who went up to the firmament and gazed upon the Shekhinah, and needed neither eating nor drinking? So too we, since we are gazing upon the Shekhinah, we need neither eating nor drinking. Even so, "and they beheld God" (Exodus 24:11), yet they needed eating and drinking, as it is said, "and they ate and drank" (ibid.). From that hour the Holy One, blessed be He, sought to stretch out His hand against them. Said the Holy One, blessed be He: I will wait until the Tabernacle is made, and they will enter to offer, and I will execute upon them the attribute of justice, as it is said, "when they drew near before the Lord, and they died" (Leviticus 16:1). Twice is "before the Lord" written: "And Nadab and Abihu died before the Lord, when they offered strange fire [before the Lord]" (Numbers 3:4). Why twice? Said the Holy One, blessed be He: Bring out the dead from before Me, for thus it is written, "Draw near, carry your brothers away from before the sanctuary" (Leviticus 10:4). As it were, when Israel is in distress, He too is with them, for thus it is written, "In all their distress He was distressed" (Isaiah 63:9). Said Rabbi Meir: "So the Lord saved on that day" (Exodus 14:30) — "He was saved" is written. Said Rabbi Abbahu: See what is written, "Before Ephraim and Manasseh, stir up Your might and come for our salvation" (Psalms 80:3) — the redemption is Yours and ours. Said the Holy One, blessed be He: In the world to come I will redeem you, and you will rejoice and I will rejoice, [as it is said,] "May the Lord rejoice in His works" (Psalms 104:31); "Let Israel rejoice in its Maker" (ibid. 149:2).
Why Nadab and Abihu Died After Gazing at the Shekhinah
Midrash Tanchuma Buber, Achrei Mot 13:3
רבותינו אומרים בשביל שזנו עיניהם מן השכינה, אמרו לא כך עשה משה שהלך לרקיע והביט בשכינה, ולא צריך לא אכילה ולא שתיה, אף אנו כיון שאנו מביטים בשכינה, אין אנו צריכין לא אכילה ולא שתיה, אעפ"י כן ויחזו את האלהים (שמות כד יא), וצרכו לאכילה ושתיה, שנאמר ויאכלו וישתו (שם), מאותה שעה בקש הקב"ה לפשוט יד בהן, אמר קב"ה אני אמתין עד שיעשה המשכן, והן נכנסין להקריב, ואני עושה בהן מדת הדין, שנאמר בקרבתם לפני ה' וימותו (ויקרא טז א), ב' פעמים כתיב לפני ה', וימת נדב ואביהוא לפני ה' בהקריבם אש זרה [לפני ה'] (במדבר ג ד), למה ב' פעמים, אמר הקב"ה הוציאו את המת מלפני, שכן כתיב קרבו שאו את אחיכם מאת פני הקודש (ויקרא י ד), כביכול כשישראל בצרה אף הוא עמהם, שכן כתיב בכל צרתם לון צר (ישעיה סג ט), אמר ר' מאיר ויושע ה' ביום ההוא (שמות יד ל), ויושע כתיב, אמר ר' אבהו ראה מה כתיב לפני אפרים ומנשה עוררה את גבורתך ולכה לישועתה לנו (תהלים פ ג), שלך ושלנו היא הגאולה, אמר הקב"ה לעולם הבא אני גואל אתכם, ואתם שמחים ואני שמח, [שנאמר] ישמח ה' במעשו (תהלים קד לא), ישמח (ה') [ישראל] בעושיו (שם קמט ב) ].