"And the LORD said unto Samuel: Hearken, etc." (1 Samuel 8:7). Rabbi Shimon ben Yochai taught: "They have rejected Me" (1 Samuel 8:7) — "Me also have they rejected" — "for it is Me also that they have rejected." He said to him: In three matters they are destined to reject — in the Kingdom of Heaven, and in the kingdom of the House of David, and in the building of the Temple. When did they reject all three of them? In the days of Rehoboam. This is what is written: "And when all Israel saw, saying: What portion have we in David?" (1 Kings 12:16) — this is the Kingdom of Heaven; "neither have we inheritance in the son of Jesse" (ibid.) — this is the kingdom of the House of David; "to your tents, O Israel; now see to your own house, David" (ibid.) — this is the building of the Temple. Rabbi Shimon ben Menasya said: Israel does not see a sign of blessing forever until they return and seek the three of them. This is what is written: "Afterward shall the children of Israel return, and seek the LORD their God" (Hosea 3:5) — this is the Kingdom of Heaven; "and David their king" (ibid.) — this is the kingdom of the House of David; "and shall fear toward the LORD and toward His goodness in the end of days" (ibid.) — this is the building of the Temple.
Three Rejections of Israel Under Rehoboam in Midrash Shmuel
Midrash Shmuel 13:4
ויאמר ה' אל שמואל שמע וגו' (שמואל א' ח' ז'), תני רבי שמעון בן יוחי אותי מאסו גם אותי מאסו, כי גם אותי מאסו, א"ל בשלשה דברים הן עתידין למאוס (עתידין למאס) [במלכות שמים ובמלכות בית דוד] ובבנין בית המקדש, אימתי מאסו בשלשתן בימי רחבעם, הדא הוא דכתיב וירא [כל] ישראל (ויאמ' אין לנו) [לאמר מה לנו] חלק בדוד (מלכים א' י"ב ט"ז), זו מלכות שמים, ולא נחלה בבן ישי (שם), זו מלכות בית דוד, (איש לאהליו) [לאהליך] ישראל עתה ראה ביתך דוד (שם), זה בנין בית המקדש. אמר רבי שמעון בן מנסיא אין ישראל רואין סימן ברכה לעולם עד שיחזרו ויבקשו שלשתן, הדא הוא דכתיב אחר ישובו בני ישראל ובקשו את ה' אלהיהם (הושע ג' ה'), זו מלכות שמים, ואת דוד מלכם (שם) זו מלכות בית דוד ופחדו אל ה' ואל טובו באחרית הימים (שם), זה בנין בית המקדש.