Ulla said: Moses sought kingship, and it was not given to him, as it is written, "And He said, Do not draw near here [halom]" (Exodus 3:5); and "here" [halom] means nothing other than kingship, as it is written, "Who am I, Lord GOD, and what is my house, that You have brought me thus far [halom]?" (2 Samuel 7:18). Rabbah objected: Rabbi Ishmael says, his brother-in-law reigned. Rabbah said: We speak of him and his offspring. And wherever "halom" is written, it refers to forever -- but is it not written of Saul, "Has the man come here [halom] yet?" (1 Samuel 10:22)? As for him, yes; his offspring, no. If you wish, say: there was Ish-bosheth. And if you wish, say: Saul is different, for the kingship did not endure even in his own person, in accordance with what Rabbi Elazar said in the name of Rav Chanina: When greatness is decreed for a person, it is decreed for him and for his offspring until the end of all generations, as it is said, "He does not withdraw His eyes from the righteous; with kings on the throne He seats them forever, and they are exalted" (Job 36:7). But if he becomes arrogant, the Holy One, blessed be He, lowers him, as it is said, "And if they are bound in fetters, caught in cords of affliction" (Job 36:8).
Why Moses Was Refused Kingship at the Burning Bush
Yalkut Shimoni on Torah 176:5
אָמַר עוּלָא, בִּקֵּשׁ מֹשֶׁה מַלְכוּת, וְלֹא נָתְנוּ לוֹ, דִּכְתִיב (שמות ג, ה) "וַיֹּאמֶר אַל תִּקְרַב הֲלֹם", וְאֵין הֲלֹם אֶלָּא מַלְכוּת, דִּכְתִיב (שמואל ב ז, יח) "מִי אָנֹכִי אֲדֹנָי אֱלֹהִים וּמִי בֵיתִי כִּי הֲבִיאֹתַנִי עַד הֲלוֹם". מֵיתֵיבֵי רַבָּה, רַבִּי יִשְׁמָעֵאל אוֹמֵר, יְבָמָהּ מָלַךְ. אָמַר רַבֶּה, לוֹ וּלְזַרְעוֹ קָאָמְרִינָן. וְכָל הֵיכָא דִּכְתִיב הֲלוֹם, עַד עוֹלָם הוּא, וְהָא גַּבֵּי שָׁאוּל כְּתִיב "הֲבָא עוֹד הֲלוֹם אִישׁ", הוּא אִין, זַרְעוֹ לָא. אִיבָּעִית אֵימָא, הָא הֲוָה אִישׁ בֹּשֶׁת. וְאִי בָּעִית אֵימָא, שַׁאנִי שָׁאוּל דַּאֲפִלּוּ בְּגַוֵיה לָא קַיְימָא, כִּדְרַב אֶלְעָזָר אָמַר רַב חֲנִינָא, בְּשָׁעָה שֶׁפּוֹסְקִים גְּדֻלָּה לָאָדָם, פּוֹסְקִין לוֹ וּלְזַרְעוֹ עַד סוֹף כָּל הַדּוֹרוֹת, שֶׁנֶּאֱמַר (איוב לו, ז) "לֹא יִגְרַע מִצַּדִּיק עֵינָיו, וְאֶת מְלָכִים לְכִּסֵּא וַיּוֹשִׁיבֵם לָנֶּצַח וַיִּגְבָּהוּ", וְאִם הֵגִיס דַּעְתּוֹ הַקָּדוֹשׁ בָּרוּךְ הוּא מַשְׁפִּילוֹ, שֶׁנֶּאֱמַר (שם, ח) "וְאִם אֲסוּרִים בְּזִקִּים יִלָּכְדוּן בְּחַבְלֵי עֹנִי".