Another interpretation: this teaches that the Holy One, blessed be He, showed him the Temple built, destroyed, and built again. "How awesome is this place" — behold it built, as you say, "You are awesome, O God, from Your sanctuaries" (Psalms 68:36). "This is none other" — behold it destroyed, as you say, "for this our heart is faint" (Lamentations 5:17). "And this is the gate of heaven" — behold it built and perfected in the time to come, as you say, "for He has strengthened the bars of your gates" (Psalms 147:13).
Jacob Shown the Temple Built, Destroyed, and Rebuilt
Yalkut Shimoni on Torah 120:4
דָּבָר אַחֵר, מְלַמֵּד שֶׁהֶרְאָהוּ הַקָּדוֹשׁ בָּרוּךְ הוּא בֵּית הַמִּקְדָּשׁ בָּנוּי וְחָרֵב וּבָנוּי. מַה נּוֹרָא הַמָּקוֹם הַזֶּה, הֲרֵי בָּנוּי, כְּמָה דְּאַתְּ אָמַר "נוֹרָא אֱלֹהִים מִמִּקְדָּשֶׁיךָ". אֵין זֶה, הֲרֵי חָרֵב כְּמָה דְּאַתְּ אָמַר (איכה ה, יז) "עַל זֶה הָיָה דָוֶה לִבֵּנוּ". וְזֶה שַׁעַר הַשָּׁמַיִם, הֲרֵי בָּנוּי וּמְשֻׁכְלָל לֶעָתִיד לָבֹא, כְּמָה דְּאַתְּ אָמַר (תהלים קמז, יג) "כִּי חִזַּק בְּרִיחֵי שְׁעָרָיִךְ".