In Islam, mosques are not just “places of prayers.” Mosques are – in modern terminology – community centers.

The role of the mosque in Islam is one of the major things that have to be reformed before the Muslim nation is capable of recovering from its present status.

How do Muslims judge what the role of the mosque is from what is not? The answer is clearly by referring to the tradition (Sunnah) of the Prophet Muhammad (peace be upon him) in the days of the message. A quick survey reveals the following roles for the Prophet’s mosque during his lifetime.

A Place for Prayers for All: The mosque of the Prophet (peace be upon him) -in Madinah- was the main place for the believers to meet for collective prayers five times a day. This is the one and only role that the mosque is playing today. However, there is still a major difference, which is that the mosque of the Prophet (peace be upon him) was opened for everybody, men and women, old and small, Arab and non-Arab. Refer, for evidence, to numerous hadith narrated in Bukhari and Muslim, for example, under the chapters referring to mosques. There are currently shortcomings in mosques in this area in the following senses:
Women are generally not allowed in the majority of mosques in the Muslim world and their “prayer area,” if exists, is usually uncared for than the “men’s area.” The Prophet’s mosque was different. There was only one area for everybody to pray. Women prayed behind men in their own lines, and the rationale was clear: Islam is avoiding that non-related men and women have such a close physical contact while – supposedly – praying to God. Praying in the Kabah is an exception from this rule for the obvious reason of space limits. Banning women from the mosques happened a couple of decades after the death of the Prophet (peace be upon him) despite the protest of some companions who narrated the Hadith: “Do not prevent the maids of Allah from visiting the houses of Allah (the mosques).”
We see, especially in nowadays West, mosques for Arabs and others, in the same vicinity, for Indians, mosques for Turks and yet others for Afros, etc. All of this is non-Islamic. The Prophet’s companions were from all sorts of backgrounds and all walks of life and they all prayed together.
We also see some people banning small children from entering the mosque, which is also contrary to the tradition of the Prophet (peace be upon him).
A Place for Socialization: The praying community used to connect in the mosque. And it is reported that the Prophet (peace be upon him) used to ask about any companion whom he missed from the mosque for a day or two to help him/her if they needed help or visit him/her if they were sick.
A Place for Da’wah (Islamic Call): There are several authentic hadiths that demonstrate that the mosque of the Prophet  was the normal place for those who would like to ask about Islam to come and ask. Non-Muslims were not banned or discouraged from the mosque as we, sadly, see today.
A Place for Celebration: The Prophet (peace be upon him) advised the companions to: “announce the wedding ceremonies, hold them in mosques, and make them known by beating the drums,” and the mosque is the place for all that.

Eid day was also a celebration day when the “Ethiopians used to play with their arrows in the mosque,” as Aisha – the Prophet’s wife – narrated. She also reported watching them while standing beside the Prophet (peace be upon him) in the mosque.

A Place for Meetings and Deliberation: The Prophet (peace be upon him) used to gather his companions in the mosque to discuss serious matters (like wars, treaties, famines, etc), and come up with decisions about them. The mosque was also the meeting place for the soldiers of the Islamic army, from which they start their march for wars and to which they return after they come back.
A Place for Medical Care! Before the Islamic civilization developed hospitals a couple of centuries later, the mosque of the Prophet (peace be upon him) was a place for care for the wounded in wars and similar crises.
A Place for Education: The illiterate used to learn how to read and write in the mosque of the Prophet (peace be upon him). Muslims developed their whole Islamic civilization based on education they got in the mosques.
The only activity that was forbidden in the mosque – in addition to the forbidden immoral acts – was buying and selling and related things. The Prophet (peace be upon him) made it a point that mosques are not to be used for material gains. Otherwise, there are numerous evidences that show that the mosque of the Prophet (peace be upon him) was simply a “community place” that is full of all sorts of activities.

Source: — Ask about Islam — Jasser Auda.