Abu Hurayrah (may Allah be pleased with him) reported that a man who drank wine was brought to the Prophet (may Allah's peace and blessings be upon him), who said: "Beat him." Abu Hurayrah added: "So some of us beat him with our hands, some with their sandals, and some with their garments (by twisting it like a lash). Then, when the man left, someone said: "May Allah disgrace you!" Upon that, the Prophet (may Allah's peace and blessings be upon him) said: "Do not say this! Do not help the devil to overpower him."
عن أبي هريرة -رضي الله عنه- قال: أُتِي النبي -صلى الله عليه وسلم- برجل قد شَرِب خمرا، قال: «اضربوه». قال أبو هريرة: فمنا الضارب بيده، والضارب بنعله، والضارب بثوبه، فلما انصرف، قال بعض القوم: أخزاك الله، قال: «لا تقولوا هكذا، لا تُعِينُوا عليه الشيطان».
شرح الحديث :
The Companions (may Allah be pleased with them) brought to the Prophet (may Allah's peace and blessings be upon him) a man who was drinking alcohol. The Prophet ordered them to beat him without specifying the number of beats, so the Companions started beating him, some with their bare hands, some with their sandals to humiliate him, and others with their clothes. They did not use a whip which is used for a prescribed punishment. Then after they ceased beating him; one of them made a supplication against him, saying: "May Allah disgrace you", asking Allah to humiliate and expose him among the people. The Prophet (may Allah's peace and blessings be upon him) instructed them not to say so as that would be helping the devil against him. If they supplicated Allah to disgrace him, perhaps Allah would answer their supplication, and the devil would thus achieve his purpose and overpower the man. Also, this supplication may alienate the man after he had received the punishment.