OK lets examine this in more details shall we?
Conditions
- The accused, before the accusation, must be known as a practicing Muslim.
- There must be four Muslim witnesses to the incident or confessions from both of the accused persons.
- The accused must possess common sense. The accused must not have been in an intoxicated state of mind while the act was committed.
- The accused must be an adult.
- The accused must have committed adultery of his/her own free will.
Qur’an
The Qur’an does not allow extramarital sex.
And go not nigh to fornication; surely it is an indecency and an evil way.
Qur’an 17:32
Moreover, the Qur’an considers extramarital sex as one of the major sins besides polytheismm and murder:
“And they who do not call upon another god with Allah and do not slay the soul, which Allah has forbidden except in the requirements of justice, and (who) do not commit fornication and he who does this shall find a requital of sin. The punishment shall be doubled to him on the day of resurrection, and he shall abide therein in abasement."
Qur’an 25:68
Punishment
Some say the punishment for adultery according to the Qur’an is noted in Surah 24 (An-Núr), Verse 2:
“The woman and the man guilty of adultery or fornication,- flog each of them with a hundred stripes: Let not compassion move you in their case, in a matter prescribed by Allah, if ye believe in Allah and the Last Day: and let a party of the Believers witness their punishment."
Qur’an 24:2
Interpretations
Javed Ahmad Ghamidi, a well-known Pakistani Islamic scholar, has examined all hadith related to Rajm in his book Burhan. Based on principles of Islamic Jurisprudence, such as the one from Shatibi, who writes that Sunnah is either explanation of the Qur’an or addition to the Qur’an. If it is an explanation, then its status is secondary otherwise, it will only be considered addition if it is not discussed by the Qur’an.[2]](Zina - Wikipedia)[3]](Zina - Wikipedia) Ghamidi concludes that Quranic punishment for Zina in verse [Qur’an 24:2] does not leave a room for another interpretation.[3]](Zina - Wikipedia) He also writes that stoning can only be prescribed for someone who rapes or habitually commits fornication as prostitutes, as it constitutes hirabah (maleficence in the land) and punishable accordingly.[4]](Zina - Wikipedia)
As it is attributed to Muhammad in following hadith:
Acquire it from me, acquire it from me. The Almighty has revealed the directive about women who habitually commit fornication about which He had promised to reveal. If such criminals are unmarried or are the unsophisticated youth, then their punishment is a hundred stripes and exile and if they are widowers or are married, then their punishment is a hundred stripes and death by stoning. Sahih Muslim 1690 The former regulations (i.e. the steps taken for the punishment to occur) also make some Muslims believe, that the process’ goal was to eventually abolish the physical penalties relating to acts of (fornication and) adultery, that were already present within many societies around the world when Islamic teachings first arose. According to this view, the principles are so rigorous in their search for evidence, that they create the near impossibility of being able to reach a verdict that goes against the suspect in any manner. [1]](http://www.asmasociety.org/perspectives/article_8.html)
Punishments may go ahead despite a lack of the forementioned evidence if those guilty of adultery or premarital sex decided to admit to their sins, and then accepted the punishment. This would be an indication of honesty and piety and if the sinner repents and vows never to commit such an act of sin again (Tawba Nasuha), then their punishment of the lashes or the stoning would acquit them of the sin they had committed on the day of judgement. If confessed in sincerity, the punishment purges the offender of the sin in the hereafter so that his or her punishment on earth is less severe by comparison than that which he or she may receive in purgatory.
Hadith
There are many hadith that outline capital punishment as a penalty for adultery, including two of the following:
Imran b. Husain reported that a woman from Juhaina came to Muhammad and she had become pregnant because of adultery. She said: I am pregnant as a result of Zina. Muhammad said: “Go back, and come to me after the birth of the child”. After giving birth, the woman came back to Muhammad, saying: “please purify me now”. Next, Muhammad said, “Go and suckle your child, and come after the period of suckling is over.” She came after the period of weaning and brought a piece of bread with her. She fed the child the piece of bread and said, “Oh Allah’s Apostle, the child has been weaned.” At that Muhammad pronounced judgment about her and she was stoned to death.
• • •
Reported by many companions that Ma’iz went before Muhammad in the Mosque and said, “I have committed adultery, please purify me.” (In another report, Muhammad asked Ma’iz that the reports he heard about him are correct or not[5]](Zina - Wikipedia)) Muhammad turned his face away from him and said “Woe to you, go back and pray to Allah for forgiveness.” But the boy again came in front of Muhammad and repeated his desire for purification. The act was repeated three times, until Abu Bakr, sitting close by, told the Ma’iz to leave, as the fourth repetition of the plea would get him stoned. But the man persisted. Muhammad then turned to him and said “you might have kissed or caressed her or you might have looked at her with lust (and so assumed that you committed Zina)”. Ma’iz replied in the negative. Allah’s Apostle said “did you lie in bed with her?” Ma’iz replied in the affirmative. He then asked, “did you have sexual intercourse?” Ma’iz replied in the affirmative. Then Muhammad got quite uncomfortable, and asked “Did your male organ disappear in the female part?” Ma’iz replied in the affirmative. He then asked, once more, whether Ma’iz knew what Zina means. Ma’iz replied “yes, I have committed the same act a husband commits with his wife.” Muhammad asked if he was married, and he replied “yes”. Muhammad asked if he took any wine, and Ma’iz again replied in the negative. Muhammad then sent for an inquiry from the neighbors of Ma’iz, whether or not Ma’iz suffered from insanity. The replies all came in the negative. Muhammad then said, “had you kept it a secret, it would have been better for you.” Muhammad then ordered Ma’iz to be stoned to death. During the stoning, Ma’iz cried out, “O people, take me back to the Holy Prophet, the people of my clan deluded me.” When this was reported to Muhammad, he replied “Why did you not let him off, he might have repented, and Allah may have accepted it.” It is reported that the woman in the above case was not punished.[6]](Zina - Wikipedia)
This makes Ghamidi believe that it was a case of rape and Ma’iz was given the punishment of hirabah and not adultery.[7]](Zina - Wikipedia)[3]](Zina - Wikipedia) In all traditions, stoning only occurred after one of the adulterers voluntarily came to Muhammad and bore witness against him or herself.
Source](Zina - Wikipedia)
This is what Ghamidi thinks. I will have to look into thoughts of other scholars as well and background of the the Hadith you presented.