Here is an imam in Lebanon teaching a student how to play soccer inside a mosque.
This generated some controversy at the time, with some Muslims being viscerally upset at the scene, while others defended it.
Is this allowed under Islam?
There are a variety of opinions. Some allow it outright outside of prayer times; some allow physical activity in a mosque only if it can be used to defeat Islam's enemies.
But other fatwa sites are very much against it. Islamquest says:
Is it permissible to conduct sports programs in the mosque, such as popular games, wrestling and...? Taking care of the sanctity of mosques and adhering to the time of prayer?Doing these things is not appropriate for mosques. Yes, if the mosque includes a special base or a place separate from it and the title of the mosque does not apply to it, and the endower did not stipulate a special type of behavior and actions, then there is no objection to holding cultural and sports ceremonies in it while preserving its sanctity.Attachments:The answer of the great tradition references to the question posed is as follows: [1]His Eminence, Grand Ayatollah Seyyed Ali Khamenei (may his high shadow extend):The mosque is not a place for sports and physical exercises, so matters that violate the sanctity of the mosque or the condition and direction of the endowment must be avoided.His Eminence, the Grand Ayatollah Al-Sayyid Al-Sistani (May Allah Extend His Shadow):This is not appropriate for mosques.His Eminence, the Grand Ayatollah Sheikh Makarem Al-Shirazi (May Allah Extend His Shadow):It is true that sport is necessary for everyone, especially for the young segment of them, but it is not appropriate for mosques or hussainiyas. You must choose another place for it.His Eminence, the Grand Ayatollah Sheikh Safi Gulbaykani (May Allah Extend His Shadow):It is not permissible to do the things mentioned in mosques.
Similarly, the IslamQA fatwa site says:
With regard to making the mosques, outside of the times of the prescribed prayers, a place where children can play in an organised fashion and on a regular basis, that is not permissible; rather it is obviously wrong, because of what it involves of imposing time restrictions on worshippers at that time, and making the mosque unavailable for the purpose for which it was built, and because it also will lead to the mosques not being respected and being exposed to the risk of contamination with dirt and impurities on some occasions, and it will expose some items in the mosque to damage, and expose the Mushafs and Islamic books to harm at the hands of children, because young children usually, if given free rein, do not refrain from spoiling things and damaging them, and doing whatever they please the place in which they play.Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said:The mosque should be protected from things that will damage it [like fireworks,, perhaps?] and disturb the people worshipping in it, even children and raising their voices and making dirty the carpets and so on, especially if it is the time of prayer, because that is one of the gravest of ills.
For some reason, however, no one seems to be upset at those who play soccer in the courtyards of Al Aqsa, or those who stockpile fireworks and rocks inside the mosque itself.
In the case of Al Aqsa, the hypocrisy is even more stark: for those who say that playing soccer is considered OK, Jews respectfully strolling and praying is considered to be a desecration. Especially since Islamic law says Jews may enter mosques (outside of Mecca) as long as they do not do anything disrespectful.
It seems that there is one sharia law for Jews in Israel and another one for everyone and everywhere else.