Not to Maintain Mosques
It is not for the polytheists to maintain Allah’s places of worship while openly disbelieving. Their deeds are worthless, and they will remain in the Fire forever.
9:17It is not for the idolaters to tend Allah's sanctuaries, bearing witness against themselves of disbelief. As for such, their works are vain and in the Fire they will abide.
The only ones who maintain Allah’s places of worship are those who believe in Him and the Last Day, establish prayer, give charity, and fear none but Allah. It is they who are expected to be rightly guided.
9:18He only shall tend Allah's sanctuaries who believeth in Allah and the Last Day and observeth proper worship and payeth the poor-due and feareth none save Allah. For such (only) is it possible that they can be of the rightly guided.