Praise be to Allah.
This question was put to Shaykh Muhammad ibn ‘Uthaymeen (may Allah have mercy on him), and he said:
Repairing mosques comes under three categories:
1.Cosmetic renovations for which there is no need. In this case there is the fear that the one who undertakes this task may be nearer to sin than to being safe from it, because if there is no need for it and the purpose is, rather, to beautify the mosque, then it is a waste of money with no benefit. The money which was spent on these renovations could have been spent on other mosques which the people could have benefitted from.
2.Renovations which are needed but not essential, such as when floor tiles or plaster are cracked, but the mosque is standing. A person will be rewarded for this, because it is like cleaning the mosque, and the Prophet (peace and blessings of Allah be upon him) commanded us to build mosques among the houses and to clean and perfume them.
3.Repairs which are essential, such as when there are cracks in the walls of the mosque or in the beams of mosques built of reinforced concrete, and the like. This comes under the same ruling as building because these repairs are essential.