In a narration in 'Musnad al-Bazzâr
that is graded as authentic, it reads
“Whoever builds a mosque for Allāh – though it be the size of the ground nest of a sandgrouse – Allāh will build for him a house in Paradise.”
Rebuilding a mosque is a way for a person to continue earning blessings after death.