"Then Joshua built an altar" (Joshua 8:30). It was taught, Rabbi says: from here is a hint to the resurrection of the dead from the Torah. It does not say "built" but "will build" [yivneh]. Similarly you say, "Then Moses will sing" (Exodus 15:1) — it does not say "sang" but "will sing"; from here is a refutation of those who say there is no resurrection of the dead from the Torah. "Whole stones" (Deuteronomy 27:6) — because the altar was created to lengthen a person's days and iron shortens a person's days, it is not right that what shortens should be lifted over what lengthens. And further, because the altar makes peace between Israel and their Father in Heaven. And the matter is an argument from the lesser to the greater: if of stones, which do not see and do not hear and do not speak, the Torah said "you shall not lift iron over them" because they make peace between Israel and their Father in Heaven, then one who makes peace between a man and his fellow, between husband and wife, between family and family, between city and city, between nation and nation — how much more so shall no calamity come upon him.
Joshua's Altar and the Iron Forbidden to Touch Its Stones
Yalkut Shimoni on Nach 18:14
אז יבנה יהושע מזבח (יהושע ח, ל). תניא רבי אומר מכאן רמז לתחיית המתים מן התורה, בנה לא נאמר אלא יבנה. כיוצא בדבר אתה אומר אז ישיר שר לא נאמר אלא ישיר מכאן תשובה לאומרים אין תחיית המתים מן התורה. אבנים שלמות שהמזבח נברא להאריך ימיו של אדם והברזל מקצר ימיו של אדם אין בדין שיניף המקצר על המאריך. ועוד שהמזבח מטיל שלום בין ישראל לאביהם שבשמים, והרי דברים קל וחומר ומה אבנים שאינם רואות ואינם שומעות ואל מדברות על ידי שמטילות שלום בין ישראל לאביהם שבשמים אמרה תורה לא תניף עליהם ברזל המטיל שלום בין אדם לחברו בין איש לאשתו בין משפחה למשפחה בין עיר לעיר בין אומה לאומה על אחת כמה וכמה שלא תבואהו פורענות: