Please see the Consensus ruling given below and understand that the masjids do not belong to the eight categories eligible for Zakat ul-Fitr as Allah has said:
The obligatory sadaqah is only for the destitute, the needy, those employed to gather it, those whose hearts incline to the truth, slaves and prisoners, people burdened with debt, those in the Cause of Allah and the traveler. This is what has been ordained and declared by Allah. And indeed Allah is All Knowing, All Wise. Surat ut-Tawbah (9), ayah 60
Giving Zakat ul-Fitr to the Masjid
The following question was put to a marja`:
Is it permissible to maintain masjids Zakah?
The marja`, Imam Muhammad Zahid Al-Kawthari (d. 1371 AH), may Allah be pleased with him, said the following on the topic:
This question was put forward by `Abdul Maqsud Muhammad and the answer was printed in the number of the issue in the month of Safar Al-Khair in the year 1366AH in Al-Azhar Magazine.
The noble teacher put a personal stamp on this answer and said, “The Imams have differed in that matter. Some consider it permitted while another party forbid it but the evidence for those who take the position of prohibition is weak. As for the understanding that it is permissible, this is based on the strong evidence on the matter.”
The claim that permissibility is based on strong evidence is their understanding so that this made the answer like begging the question. He made the permissibility revolve around all acts of righteousness but not maintaining the masjids.
You can see the following statement from Ibn Hubairah Al-Hanbali on the topic:
“The scholars have unanimously agreed on that it is neither permissible to discharge the Zakah for the building of a masjid nor the enshrouding and burying of the dead; this is even if it is the near relative that has Zakah set aside for that individual.”
By “unanimously” he is referring to the Consensus of Abu Hanifah, Malik ibn Anas, Ash-Shafi`ii and Ahmad ibn Hanbal and their students on the impermissibility of discharging the Zakah to the masjid. This shows the agreement of those before them on the matter from the fiqh scholars of the Companions and Followers.
Imam Malik ibn Anas in Al-Mudawwanah is quoted as saying,
“It is not permissible that any of the individual’s zakah be given for the burial shroud or interment of the deceased as this type of Sadaqah is only for the destitute, the needy and the rest that Allah has mentioned. This form of sadaqah is not to be given for the dead nor the building of the masjids.” 
Ibn Hazm mentioned in Al-Muhalla:
“When the topic of Zakat ul-Fitr is discussed, one of the grades is ‘striving in the Cause of Allah in the literal sense.’ ” 
This is a hadith of `Ata’ ibn Yassar being made reference to on the topic. Ibn Hazm further said, “The hadith runs, It is not permissible to give this type of Sadaqah to a wealthy man except a fifth given to the warrior marching out in the Cause of Allah. This is based in the hadith.” 
The argument being put forward is that the intent of “in the Cause of Allah” is that the Zakah may be discharged to the individual that is a warrior marching out to war. The author of Al-Muhalla goes on to say,
“There is no dispute in that He, Exalted be He, was not making reference to every type of righteousness in the topic of people deserving to receive Sadaqah. Thus Zakah is not to be given except when there is a clear text and this was already mentioned by ourselves beforehand.” 
This refers to the warrior and he is specifically mentioned in the ayah under the heading of in “the Cause of Allah” in the aforementioned hadith which was collected by Malik ibn Anas, `Abdur-Razzaq As-Sana`ani, Abu Dawud and Ibn Majah.
This is evidence that the sense of “Cause of Allah” makes clear reference to the warrior as the context of the word and the ayah is agreed upon among the fiqh scholars of the Companions, their Followers and those after him up until the time of Ibn Hazm.
Al-Qadi Abu Bakr ibn Al-`Arabi said in Ahkam ul-Qur’an:
“Imam Malik said, ‘The Causes of Allah are many but I do not know of any dispute in that the intent of the Cause of Allah in the ayah here is none other than war.’ ” 
After citing the hadith of `Ata’ ibn Yassar previously referenced, Imam Muhammad ibn Al-Hasan Ash-Shaibani said in Al-Muwatta’,
“Muhammad has said, ‘By this understanding we know that the warrior is who is being referenced in the Cause of Allah.’ ” 
Imam Badr ud-Din Al-`Aini has said in `Umdat ul-Qari:
“Ibn Al-Mundhir explained in his text Al-Ishraf: ‘The statement of Abu Hanifah and Al-Qadi Abu Yusuf is that the expression in the Cause of Allah refers to a warrior who is not wealthy and is enriched.
Abu Thawr narrated from Abu Hanifah that the warrior is less than the Hajj goer. Ibn Battal mentioned that this is the statement of Abu Hanifah, Malik and Ash-Shafi`ii. A similar statement was mentioned by Imam An-Nawawi in his commentary on Al-Muhadh-dhab.’
Ibn Al-Mundhir attributed to Abu Hanifah and his companions that they made it a condition that the warrior be poor in order for him to be a recipient of the Zakah as mentioned in the ayah.
The intent of this is clear and the ruling is that it is praiseworthy to give Zakah to the poor warrior headed out to battle as we have narrated from Imam Muhammad.” 
In deducing the evidence for the companions of Ash-Shafi`ii on that the intent of ‘in the Cause of Allah’ refers to warfare, Imam Yahya An-Nawawi in his Al-Majmu` said the following:
“Our Companions deduce as proof that the understanding is use. The immediate and first meaning of the expression ‘in the Cause of Allah, Exalted be He,’ goes to warfare. Most of what has come in the Mighty Qur’an using this expression refers to warfare.
The Companions of the School also deduce as proof of this the hadith, ‘Sadaqah is not permitted for the wealthy one except in the case of the fifth to be given.’ And of the categories he mentioned was the warrior. And of the eight categories mentioned in the ayah, no one has been given the title of combat besides those given a portion ‘in the Cause of Allah.’ ” 
The reality in the Revealed Law is immediately seen by the understanding used by the people of the Revealed Law.
 499-560 AH (AD 1105-1165). He is Abul Muzaffar Yahya ibn Muhammad ibn Hubairah Ash-Shaibani Al-Baghdadi. Hanbali marja` and extensive writer on the topic of Usul ul-Fiqh.
 Al-Ifsah, pp. 106-108
 Al-Mudawwanah, vol.2, pp. 59-60
 384-456 AH (AD 994-1064). He is Abu Muhammad `Ali ibn Ahmad ibn Sa`id ibn Hazm ibn Ghalib Al-Farsi Al-Qurtubi. Persian man of letters, he attempted to revive and popularise a contrived madhhab. He is often used by liberals and false academics in quoting bizarre legal understandings or for dispensations on agreed upon matters. cf. Ibn Al-`Imad in Shadharat udh-Dhahab, vol.3, pp. 296-299
 Al-Muhalla, vol.6, pp. 149-151
 Al-Muhalla, vol.6, pp. 149-151
 Al-Muhalla, vol.6, pp. 149-151
 468-543 AH (AD 1076-1149). He is Muhammad ibn `Abdullah ibn Muhammad Al-Ishbili Al-Maliki. Contemporary and student of Hujjat ul-Islam Al-Ghazzali, he is the author of many famous works and a high level authority in the Maliki school of fiqh. cf. Ibn Al-`Imad in Shadharat udh-Dhahab, vol.4, pp. 139-141
 Ahkam ul-Qur’an, vol.1, pp. 394-397
 Al-Muwatta’, pp. 177-179
 762-855 AH (AD 1361-1451). He is Abu Muhammad Badr ud-Din Mahmud ibn Ahmad ibn Musa ibn Ahmad Al-`Aini Al-Hanafi. Hadith commentator and Hanafi marja`, he was Cairo’s most senior fiqh and hadith scholar in his time. He wrote the indispensable Hanafi commentator on Al-Bukhari, `Umdat ul-Qari Sharh Sahih il-Bukhari.
 `Umdat ul-Qari fi Sharh il-Bukhari, vol.4, pp. 390-392
 Al-Majmu` Sharh ul-Mahadh-dhab, vol.6, pp. 210-212