"You have gone too far, sons of Levi" (Numbers 16:7). Behold, I told you! They were not fools, for thus did he warn them, and they took it upon themselves. They sinned against their own lives, as it is said, "the censers of these who sinned at the cost of their lives" (Numbers 17:3). And Korah, who was shrewd, what did he see to do this folly? Rather, his eye misled him. He saw a great chain standing forth from him: Samuel, who was equal to Moses and Aaron, and twenty-four watches standing forth from his sons, all of whom would prophesy by the Holy Spirit, [as it is said,] "all these were sons of Heman, the king's seer in the words of God, to exalt the horn" (1 Chronicles 25:5). He said: Is it possible that this greatness is destined to stand forth from me, and I should perish? But he did not see well, for his sons would stand in repentance, and they would come forth from them. Thus did he see. Therefore he acted foolishly in coming to that statute which he heard from the mouth of Moses, that they would all perish and one would escape, and "the man whom the Lord chooses, he is the holy one."
Why Korah Rebelled and Failed to Foresee His Sons' Repentance
Midrash Tanchuma Buber, Korach 12:1
רב לכם בני לוי (שם שם ז). הרי אמרתי לכם, לא טיפשין היו, שכך התרה בהם וקיבלו עליהם, הם חטאו על נפשותם, שנאמר את מחתות החטאים האלה בנפשות (שם יז ג), וקרח שפיקח היה מה ראה לעשות שטות זו, אלא עינו הטעתו, ראה שלשלת גדולה עומדת ממנו, שמואל ששקול כמשה ואהרן, ועשרים וארבע משמרות עומדות מבניו, שכולן מתנבאין ברוח הקודש, [שנאמר] כל אלה בנים להימן חוזה המלך בדברי (אלהים) [האלהים] להרים קרן (דה"א כה ה), אמר אפשר הגדולה הזאת עתידה לעמוד ממני, ואני אובד ולא ראה יפה, לפי שבניו עומדין בתשובה ויוצאין מהן, כך היה רואה, לכך נשתטה לבוא לאותה חוקה ששמע מפי משה שכולם אבודין ואחד פלט, והיה האיש אשר יבחר ה' הוא הקדוש.