"And Abraham came to mourn for Sarah and to weep for her" (Genesis 23:2). They inquired: Is a eulogy an honor due to the living [the surviving relatives] or an honor due to the dead? What practical difference does it make? It makes a difference for one who said, "Do not eulogize that man [me]"; or, alternatively, to exclude the heirs [from the cost], what is the ruling? Come and hear: "And Abraham came to mourn for Sarah." If you say it is on account of the honor of the living, would Abraham have left Sarah unburied [merely] for the sake of Abraham's own honor? Sarah herself was content, since through it Abraham would be honored. Come and hear: Rabbi Natan says, it is a good sign for the dead that punishment is exacted from him after death: a corpse that was not eulogized and not buried, or that a wild beast dragged off, or upon whose bier the rains were dripping. Learn from this that it is an honor due to the dead. Learn from this.
Whose Honor Is a Eulogy, the Living or the Dead
Yalkut Shimoni on Torah 102:12
וַיָּבֹא אַבְרָהָם לִסְפֹּד לְשָׂרָה וְלִבְכֹּתָהּ, אִבָּעְיָא לְהוּ הֶסְפֵּדָא יְקָרָא דְּחַיֵי הוּא אוֹ יְקָרָא דְּשָׁכְבֵי הוּא לְמַאי נַפְקָא מִנָּהּ, נַפְקָא מִנָּהּ לְהַהוּא דְּאָמַר לֹא תִּסְפְּדוּ לְהַהוּא גַבְרָא, אִי נַמִּי לְאַפּוּקֵי מִיוֹרְשִׁין מַאי. תָּא שְׁמַע וַיָבֹא אַבְרָהָם לִסְפֹּד לְשָׂרָה, אִי אַמְרֵת מִשּׁוּם יְקָרָא דְּחַיֵּי הוּא מִשּׁוּם יְקָרָא דְּאַבְרָהָם מַשְׁהוּ לְהוּ לְשָׂרָה שָׂרָה גוּפָהּ נִיחָא לָהּ כִּי הֵיכֵי דְּמִתְיַקַּר בָּהּ אַבְרָהָם. תָּא שְׁמַע, רַבִּי נָתַן אוֹמֵר, סִימָן יָפֶה לְמֵת שֶׁנִּפְרָעִין מִמֶּנוּ לְאַחַר מִיתָה מֵת שֶׁלֹּא נִסְפַּד וְלֹא נִקְבַּר אוֹ שֶׁחַיָה גֹרַרְתּוֹ אוֹ שֶׁהָיוּ גְּשָׁמִים מְזַלְּפִין עַל מִטָּתוֹ, שְׁמַע מִנָּהּ יְקָרָא דְּשָׁכְבֵי הוּא שְׁמַע מִנָּהּ.