Performing the temple ordinances for our deceased ancestors is necessary for our salvation and their salvation.
15 And now, my dearly beloved brethren and sisters, let me assure you that these are principles in relation to the dead and the living that cannot be lightly passed over, as pertaining to our salvation. For their salvation is necessary and essential to our salvation, as Paul says concerning the fathers—that they without us cannot be made perfect—neither can we without our dead be made perfect.
The Prophet Joseph Smith said:
“The greatest responsibility in this world that God has laid upon us is to seek after our dead. The apostle says, ‘They without us cannot be made perfect’ [Hebrews 11:40]; for it is necessary that the sealing power should be in our hands to seal our children and our dead for the fulness of the dispensation of times—a dispensation to meet the promises made by Jesus Christ before the foundation of the world for the salvation of man.”
(Teachings of Presidents of the Church: Joseph Smith , 475.)