"The LORD shall reign forever and ever" (Exodus 15:18). Rabbi Yose says: Had Israel said at the sea "The LORD reigns forever and ever," no nation would ever have ruled over them. But they said, "The LORD shall reign forever and ever," referring to the time to come. "But we are Your people, Your flock, the sheep of Your pasture, the seed of Abraham who loves You, the children of Isaac Your only one, the congregation of Jacob Your son, Your firstborn, the vine that You brought out of Egypt, and the stock that Your right hand planted." Why "The LORD shall reign forever and ever"? Because "the horse of Pharaoh went in," and so on. Rabbi changed [the schedule] for his son, who was at the house of Rabbi Yose ben Zimra. They set for him twelve years to go to the academy. They brought the bride before him, and he said to them, "Let it be six years." They again brought her before him, and he said, "Let me marry her first and then go." He was embarrassed before his father, who said to him: "My son, you have the understanding of your Maker. At first it is written, 'You shall bring them in and plant them' (Exodus 15:17), and only at the end is it written, 'They shall make Me a sanctuary, and I will dwell among them' (Exodus 25:8)." He married her, went and sat twelve years at the academy, and by the time he returned his wife had become barren. Rabbi said: "What shall we do? If he divorces her, people will say this poor woman waited in vain; if he marries another woman, people will say this one is his wife and that one his harlot." He prayed for mercy on her behalf and she was healed. Rabbi Elazar said: Any person in whom there is knowledge, it is as though the Temple were built in his days, for this [knowledge] is set between two divine names, as it is said, "For a God of knowledge is the LORD" (1 Samuel 2:3), and this [the sanctuary] is set between two divine names, as it is said, "You have made, O LORD, the sanctuary of the LORD."
The Lord Shall Reign and the Scholar Who Builds the Temple
Yalkut Shimoni on Torah 253:4
ה' יִמְלֹךְ לְעֹלָם וָעֶד. רַבִּי יוֹסִי אוֹמֵר אִ[י]לּוּ אָמְרוּ יִשְׂרָאֵל עַל הַיָּם "ה' מֶלֶךְ לְעֹלָם וָעֶד" לֹא הָיְתָה אֻמָּה שׁוֹלֶטֶת בָּהֵן לְעוֹלָם, אֶלָּא אָמְרוּ ה' יִמְלֹךְ לְעֹלָם וָעֶד לֶעָתִיד לָבֹא. אֲבָל אֲנַחְנוּ עַמְּךָ עֶדְרְךָ צֹאן מַרְעִיתֶךָ זֶרַע אַבְרָהָם אֹהַבְךָ בְּנֵי יִצְחָק יְחִידְךָ עֲדַת יַעֲקֹב בִּנְךָ בְּכוֹרֶךָ "גֶּפֶן שֶׁהִסַּעְתָּם מִמִּצְרַיִם וְכַנָּה אֲשֶׁר נָטְעָה יְמִינֶךָ". ה' יִמְלֹךְ לְעֹלָם וָעֶד, מִפְּנֵי מַה, כִּי בָא סוּס פַּרְעֹה וְגוֹ'. רַבִּי אִיעֲסַק לֵיהּ לִבְרֵיהּ בֵּי רַבִּי יוֹסִי בֶּן זִמְרָא, פָּסְקוּ לֵיהּ תְּרֵיסָר שְׁנִין לְמֵיזַל לְבֵי רַב, אַחְלְפוּהָ קַמֵּיהּ. אָמַר לְהוּ, [נֵיהֲווּ שִׁית שְׁנִין, אַחְלְפוּהָ קַמֵּיהּ אָמַר לְהוּ] אִיכְנוּס וַהֲדַר אֵיזִיל, הֲוָה קָא מִיכְסִיף מֵאֲבוּהָ אָמַר לֵיהּ בְּנִי דַּעַת קוֹנְךָ יֵשׁ בְּךָ, מֵעִיקָרָא כְּתִיב תְּבִאֵמוֹ וְתִטָּעֵמוֹ וּלְבַסּוֹף כְּתִיב (שמות כה, ח) "וְעָשׂוּ לִי מִקְדָּשׁ [וְשָׁכַנְתִּי בְּתוֹכָם"], נָסְבָהּ אֲזַל יָתִיב תְּרֵיסָר שְׁנֵי בְּבֵי רַב עַד דְּאָתָא. אִיעַקְרָא דְּבִיתְהוּ. אָמַר רַבִּי, הֵיכֵי נַעֲבִיד, נִגָּרְשָׁהּ, יֹאמְרוּ עֲנִיָּה זוּ לַשָּׁוְא שָׁמְרָה, לִנְסִיב אִיתְּתָא אַחֲרִיתִי, יֹאמְרוּ זוּ אִשְׁתּוֹ וְזוּ זוֹנָתוֹ, בָּעָא עָלָהּ רַחֲמֵי וְאִיתְּסִיאַת. אָמַר רַבִּי אֶלְעָזָר, כָּל אָדָם שֶׁיֵּשׁ בּוֹ דֵּעָה כְּאִלּו נִבְנָה בֵּית הַמִּקְדָשׁ בְּיָמָיו, שֶׁזֶּה נִתַּן בֵּין שְׁתֵּי שֵׁמוֹת, שֶׁנֶּאֱמַר (שמואל א ב, ג) "כִּי אֵל דֵּעוֹת ה'", וְזֶה נִתַּן בֵּין שְׁתֵּי שֵׁמוֹת, שֶׁנֶּאֱמַר פָּעַלְתָּ ה' מִקְּדָשׁ ה'.