Praise be to Allah.
Allah, may He be exalted, says (interpretation of the meaning):
“O you who believe! Approach not AsSalat (the prayer) when you are in a drunken state until you know (the meaning) of what you utter, nor when you are in a state of Janaba, (i.e. in a state of sexual impurity and have not yet taken a bath) except when travelling on the road (without enough water, or just passing through a mosque), till you wash your whole body. And if you are ill, or on a journey, or one of you comes after answering the call of nature, or you have been in contact with women (by sexual relations) and you find no water, perform Tayammum with clean earth and rub therewith your faces and hands (Tayammum). Truly, Allah is Ever Oft-Pardoning, Oft-Forgiving”
More than one of the scholars have quoted this verse as evidence that one who is in a drunken state should not be allowed to enter the mosque.
Al-Qurtubi (may Allah have mercy on him) said:
The scholars differed as to what is meant by the word “the prayer” here. Some of them said that it refers to the act of worship itself – this is the view of Abu Haneefah – hence He said “until you know (the meaning) of what you utter”. Others said that what is meant is the places of prayer – this is the view of ash-Shaafa‘i – because elsewhere Allah says (interpretation of the meaning): “For had it not been that Allah checks one set of people by means of another, monasteries, churches, synagogues, and mosques [salawaat], wherein the Name of Allah is mentioned much would surely have been pulled down” [al-Hajj 22:40]; here the places of prayer (mosques) are called salawaat (lit. ‘prayers’). This interpretation is also supported by the fact that Allah says (in an-Nisa’ 4:43): “nor when you are in a state of Janaba, (i.e. in a state of sexual impurity and have not yet taken a bath) except when travelling on the road (without enough water, or just passing through a mosque)”. This implies that it is permissible for one who is in a state of janaabah to pass through the mosque but not to pray therein. Other scholars said that what is meant is both the place and the prayer, because at that time they would only come to the mosque to pray and they only prayed in congregation, hence the two were inseparable.
End quote from Jaami‘ li Ahkaam al-Qur’an, 6/333
This is supported by the fact that his entering the mosque does not serve any purpose, because he is not allowed to pray in a drunken state, according to the verse quoted above. Moreover, his entering the mosque may result in a number of negative consequences:
1.Usually one who is drunk utters inappropriate words
2.One who is drunk often causes annoyance or makes the place dirty, and he will have a foul smell and may act in an odd manner, and the mosque should be protected from such things.
3.One who is drunk often distracts the people in the mosque from their worship with his words and actions.
Allah, may He be exalted, says (interpretation of the meaning): “In houses (mosques), which Allah has ordered to be raised (to be cleaned, and to be honoured), in them His Name is glorified in the mornings and in the afternoons or the evenings” [an-Noor 24:36]. Allah has ordained that the mosques should be raised, i.e., purified of all dirt and foul speech, and words and deeds that are not appropriate in that place. ‘Ali ibn Abi Talhah narrated that Ibn ‘Abbaas said, concerning the verse “In houses (mosques), which Allah has ordered to be raised”: Allah, may He be glorified, has forbidden idle talk and foul speech therein.
Something similar was stated by ‘Ikrimah, Abu Saalih, ad-Dahhaak, Naafi‘ ibn Jubayr, Abu Bakr ibn Sulaymaan ibn Abi Hathmah, Sufyaan ibn Husayn and other scholars and mufassireen. End quote.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
The prayer of one who is drunk and does not know what he is saying is not valid, according to scholarly consensus. In fact it is not permissible to allow him to enter the mosque, because of this verse and others, because the prohibition is on approaching the prayer and approaching the places of prayer. And Allah knows best.
End quote from Majmoo‘ al-Fataawa, 22/6
The author of Mataalib Ooli an-Nuha fi Sharh Ghaayat al-Muntaha (2/256) said: those who are like the drunkard, such as the insane, should be kept away from it, i.e., the mosque, so as to protect it. End quote.
But what we advise you to do is to be gentle and kind to him when making him leave the mosque, so as to protect the mosque from idle talk and foul speech and so as to prevent division and arguments between the Muslims in the mosque, in the hope that this may soften his heart and he will feel comfortable in the mosque, and make him feel ashamed of his reprehensible actions when he sobers up and realizes how kind the people were to him even though he was in such a terrible state.
And Allah knows best.