In the name of Allah, the Gracious, the Merciful
There are thousands of traditions reported about the Prophet (s) and interpreting them sometimes requires a deeper reading of a particular text, and its context in history and the whole of Islamic teachings, to acquire understanding of the religion. In general, if we come across a narration that seems confusing on its face, we should assume the best about the Prophet (s) and investigate scholarly interpretations before judging it.
Ali ibn Abi Talib, may Allah be pleased with him, said:
إِذَا حَدَّثْتُكُمْ عَنْ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ حَدِيثًا فَظُنُّوا بِهِ الَّذِي هُوَ أَهْنَاهُ وَأَهْدَاهُ وَأَتْقَاهُ
When I narrate to you a tradition from the Messenger of Allah, peace and blessings be upon him, assume from it that he is the most proper, the most guided, and the most righteous.
Source: Sunan Ibn Majāh 20, Grade: Sahih
One such narration involves Ali (ra) himself, when the Prophet (s) apparently ordered him to kill a man accused of adultery without the usually required testimony of four public witnesses (an almost impossibly high standard of evidence).
Anas ibn Malik reported: A man was accused of adultery with the concubine mother (umm al-walad) of the Messenger of Allah, peace and blessings be upon him, so he ordered Ali to go and strike his neck. Ali came to the man while he was cooling himself in a well. Ali told him to come out and grabbed him by the hand, but when he came out, he saw that he was a eunuch and had no genitalia. Ali refrained from harming him and he went to the Prophet, saying:
يَا رَسُولَ اللَّهِ إِنَّهُ لَمَجْبُوبٌ مَا لَهُ ذَكَرٌ
O Messenger of Allah, he is a eunuch and he has no genitalia.
Source: Ṣaḥīḥ Muslim 2771, Grade: Sahih
Some people misunderstand a few important points by reading their personal assumptions and biases into this isolated narration. First, concubines are not sex slaves, but rather were analogous to wives with their own set of rights, which included not being harmed or compelled into sexual intercourse.
Second, there is the question of why the Prophet (s) did not apply the ordinarily high burden of proof before allegedly sentencing a man to death. Yet the lesson of this tradition is not about law. Imam Muslim, who narrated the tradition, did not include it in his book of legal judgments and so he did not understand it as setting a legal precedent. So what is the lesson?
There are a few possible interpretations of the meaning of this incident, but perhaps the best opinion is that the Prophet (s) had not intended to kill the man at all. He knew the man was innocent of the charge, so he set up a scenario in which Ali and the public would discover the truth for themselves.
Abu Muhammad ibn Hazm writes:
من ظن أنه صلى الله عليه وسلم أمر بقتله حقيقة بغير بينة ولا إقرار فقد جهل وإنما كان النبي صلى الله عليه وسلم يعلم أنه بريء مما نسب إليه ورمي به وأن الذي ينسب إليه كذب فأراد صلى الله عليه وسلم إظهار الناس على براءته يوقفهم على ذلك مشاهدة فبعث عليا ومن معه فشاهدوه مجبوبا أي مقطوع الذكر فلم يمكنه قتله لبراءته مما نسب إليه وجعل هذا نظير قصة سليمان في حكمه بين المرأتين المختلفتين في الولد فطلب السكين ليشقه نصفين إلهاما ولظهور الحق
Whoever assumes that the Prophet (s) truly commanded his killing without evidence or due process is ignorant. Indeed, he knew the man was innocent of what he was accused, that those who attributed it to him were lying. He intended to show people his innocence and for them to agree upon it by witnessing to it. He sent Ali and those with him to bear witness that he was a eunuch – his genitalia was cut – so they did not carry out his killing due to what was attributed to him. He made this an equivalent lesson to the story of Solomon in his wisdom between the two women differing over the child, so he brought the knife pretending to cut him into two parts to show them the truth.
Source: Subul al-Hudá wal Rashād 10/432
In the famous story of Solomon, peace be upon him, two women both had claimed a child as their own. To resolve the dispute, Solomon ordered his companions to bring a knife and cut the child into two pieces. Upon hearing this, the real mother relented rather that seeing her child killed, thus the true mother was revealed. He had never planned to harm the child.
Likewise, the Prophet (s) initially gave the order to kill the man but, being guided by divine revelation, he knew that the situation would resolve itself on its own. It was a teaching mechanism for Ali, who would later become the fourth of the righteous caliphs and who was famous for his wise judgment. Ali learned not to make assumptions of guilt from hearsay alone.
As in the story of Al-Khidr and Moses in Surat al-Kahf, one should not rush to judgment based merely upon outward appearances, but rather one must gather all the facts (i.e. context) before an appropriate conclusion can be made.
In a similar reading, the man had indeed misbehaved by improperly secluding himself with the concubine Maryah but he had not committed adultery, so the Prophet (s) only intended to frighten him for doing so while at the same time publicly proving his innocence.
Ibn al-Qayyim writes:
وَتَأَوَّلَهُ بَعْضُهُمْ عَلَى أَنَّهُ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ لَمْ يُرِدْ حَقِيقَةَ الْقَتْلِ إِنَّمَا أَرَادَ تَخْوِيفَهُ لِيَزْدَجِرَ عَنْ مَجِيئِهِ إِلَيْهَا قَالَ وَهَذَا كَمَا قَالَ سُلَيْمَانُ لِلْمَرْأَتَيْنِ اللَّتَيْنِ اخْتَصَمَتَا إِلَيْهِ فِي الْوَلَدِ عَلَيَّ بِالسِّكِّينِ حَتَّى أَشُقَّ الْوَلَدَ بَيْنَهُمَا وَلَمْ يُرِدْ أَنْ يَفْعَلَ ذَلِكَ بَلْ قَصَدَ اسْتِعْلَامَ الْأَمْرِ مِنْ هَذَا الْقَوْلِ
وَلِذَلِكَ كَانَ مِنْ تَرَاجِمِ الْأَئِمَّةِ عَلَى هَذَا الْحَدِيثِ بَابُ الْحَاكِمِ يُوهِمُ خِلَافَ الْحَقِّ لَيُتَوَصَّلَ بِهِ إِلَى مَعْرِفَةِ الْحَقِّ فَأَحَبَّ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ أَنْ يَعْرِفَ الصَّحَابَةُ بَرَاءَتَهُ وَبَرَاءَةَ مارية وَعُلِمَ أَنَّهُ إِذَا عَايَنَ السَّيْفَ كَشَفَ عَنْ حَقِيقَةِ حَالِهِ فَجَاءَ الْأَمْرُ كَمَا قَدَّرَهُ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ
Some interpret the tradition as if the Prophet (s) truly did not intend to kill him. Indeed, he only intended to frighten him as a rebuke for coming near to her. They said it was as Solomon had said to the two women disputing each other about the child: I will bring the knife until I cleave the child in half. He did not intend to do that, but rather his purpose was to make the matter of this statement known.
For this reason, the Imams understood the lesson of this tradition to be that the judge can pretend to believe differently from the truth as a means to arrive at recognition of the truth. The Prophet (s) liked for the innocence of the companion to be made known, as well as the innocence of Maryah. He knew that when the man saw the sword, he would reveal the reality of his condition and thus the matter concluded as the Prophet had estimated.
Source: Zād al-Ma’ād 5/15
In this view, it was from the prophetic wisdom that the Prophet (s) would know that Ali would have discovered the truth and arrived at the correct judgement for himself, thereby exonerating both the man and Maryah of the accusations against them.
We should always assume the best of the Prophet (s) whenever we come across narrations that, on a superficial level, seem to contradict the Quran or the whole of Islamic teachings. The Prophet was divinely inspired and therefore his actions, while sometimes counter-intuitive at first, reveal profound wisdom when fully investigated in context.
As for those who deliberately misrepresent the Sunnah, our only duty is to clearly convey the truth to whomever wishes to know it.
Success comes from Allah, and Allah knows best.