Question: What is the ruling on presenting food to the Masaajid with the intention of charity?
Answer: “There is no harm in presenting food to the Masaajid for the poor to eat from, however, not on a continuous basis. If it is on a continuous basis, the Masaajid will become a house and a shelter. If it is an expected affair like iftar in Ramadan, then there is no harm in that with the condition that it does not harm the people of the Masjid and dirty the Masjid.
The action of the people today is like this. As for us making the Masjid a coffee shop or restaurant, then this is not allowed. The Masaajid were not built for this. So there is a difference between temporary, unexpected affairs and continuous, ongoing affairs”.
[Taken from: https://audio.islamweb.net/audio/index.php?page=FullContent&audioid=315795#332989]
Faisal Ibn Abdul Qaadir Ibn Hassan