"In the wilderness of Sinai" (ibid., i.e., Numbers 3:4). [Rabbi Meir said:] Did they then die in the wilderness of Sinai? Rather, from Mount Sinai they received their verdict of death, [though they died only later at the Tent of Meeting]. [This may be compared] to a king who was marrying off his daughter, and something filthy was found in his groomsman. The king said: If I put him to death [now], I will hold up the rejoicing of my daughter. Tomorrow my own celebration is coming; better [that I deal with him] at my own celebration and not at my daughter's celebration. So too the Holy One, blessed be He, said: If I put Nadab and Abihu to death now, I will hold up the rejoicing of the Torah. Tomorrow My own celebration is coming; better [that it be] at My own celebration and not at the celebration of the Torah. This is what is written (Song of Songs 3:11): "On the day of his wedding, and on the day of the gladness of his heart" — "on the day of his wedding," this is the day of the giving of the Torah; "and on the day of the gladness of his heart," this is the Tent of Meeting.
Why God Delayed the Death of Nadab and Abihu
Midrash Tanchuma Buber, Achrei Mot 8:2
במדבר סיני (שם שם), [אמר ר' מאיר] וכי במדבר סיני מתו, אלא שמהר סיני נטלו איפופסין שלהם למיתה. למלך שהיה משיא את בתו, ונמצא בשושבינון שלו דבר זוהמא, אמר המלך אם אני הורגו אני מעכב בשמחת בתי, למחר שמחתי באה, מוטב בשמחתי ולא בשמחת בתי, כך אמר הקב"ה אם אני הורג נדב ואביהוא עכשיו, אני מעכב את שמחת התורה, למחר שמחתי באה, מוטב בשמחתי ולא בשמחת התורה, הה"ד ביום חתונתו וביום שמחת לבו (שה"ש ג יא), ביום חתונתו זה יום מתן תורה, וביום שמחת לבו זה אהל מועד.