2 – The underlying wisdom in this—Allah knows best—is that enforcing the ḥudūd is usually accompanied by uproar and raised voices; moreover, the penalty may soil the mosque with blood or other substances that come from the person upon whom the punishment is inflicted.
3 – The ḥadith therefore shows that administering the fixed legal punishments inside a mosque is prohibited, for a prohibition (nahy) denotes unlawfulness. Sharḥ al-Muntahā states: “It is unlawful to carry out a ḥadd in a mosque because of the report of Ḥakīm ibn Ḥizām, and because one cannot be certain that nothing will occur which would defile the mosque.”
If, however, the punishment is in fact carried out there, it need not be repeated, for the purpose of deterrence has already been achieved.