Who ever builds a Masjid for Allah, Allah will Build for him a similar House in Paradise" (Hadith)
To spend in the path of Allah Ta'ala by way of propagating the Deen of Allah is highly meritorious and rewarding. Reward attained through the performance of certain good deeds affords the continuity of reward even after death.
Indeed fortunate are those who have reaped such tremendous benefits and Insha Allah will bear the fruits in the hereafter.
Abu Hurairah (RadiAllahAnho)) has reported the messenger of Allah as saying, "Among the actions and good deeds for which a believer will continue to receive reward, after his death, are knowledge which he taught and spread, a good son whom he left behind, or a copy of the Qur'an which he left as a legacy, or a mosque which he erected, or a house which he built for the traveller, or a stream which he caused to flow, or a Sadaqah which he gave from his property when he was alive and well, for which he will continue to receive reward after his death". (Ibn Majah - Mishkat)