Barring Someone Who Committed an Evil Deed from the Mosque
Question
A certain man was very devoted to tahajjud; he would come to the mosque for prayer daily 15 minutes early and leave the mosque half an hour afterwards. One day he was caught committing fornication with a boy. He asked for forgiveness and was let go. Despite this, he did the same thing again and was caught; he himself also confessed, but did not ask for forgiveness. The act was committed in a room near the mosque. People barred him from coming to the mosque, and now he does not come to the mosque but prays at home.
Answer
He should not be barred from coming to the mosque and praying. However, arrangements should be made so that he cannot commit that vile act again: he should pray only the fard prayer with the congregation, and for this he should come exactly at the time of the congregation and, after praying the fard, leave at once, and pray the sunnas and nafls after going home.
Source: Fatawa Mahmudiyya
Preview. The full text opens with JavaScript enabled.