Sayyiduna Hakim bin Hizam (may Allah be pleased with him) said: The Prophet (peace and blessings be upon him) forbade that retaliation be taken in the mosques, or that poetry be recited in them, or that hadd punishments be carried out in them.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأشربة والحد فيها / 17591