A story from the life of the Prophet not only illustrates why such crimes are so harmful, but is eerily reminiscent of the current situation. Quoted in Bukhari, Muslim, Abu Dawud and several other authenticated stories of the Prophet's life, it tells about a small group of nomadic men who wandered from the desert into Medina when Muhammad lived their, and finding him, claimed to be Muslims and asked for shelter. Winter had come to the region and the men were sick and badly malnourished. Feeling pity for them, Muhammad gave them shelter, food and allowed them access to several female camels for milk. They lived among the Muslims in Medina for a long period, gaining the trust of many and seeming to have joined the society. But one night, after the weather had improved and their health was restored, they killed the attendant who cared for the camels and disappeared into the night with the animals.
Arabia at that time was full of such nomadic people, and they often attacked and pillaged desert caravans. But this crime was different and unexpected to the Muslims. These men had come to the city, claiming to be one of them--claiming to be Muslims--and had been accepted. But they had lied and murdered. Who among the other nomads living now among them in Medina and claiming to be Muslims were also murders, waiting for the right moment to strike?
Then as today, such suspicions quickly can undermine a society, making people deeply distrustful of one other, creating fear and anarchy.
For this reason, not only does the Qu'ran spell out the judicial punishment, but also warns that an "awesome" suffering awaits in the afterlife.
But as is the case with the execution of any Islamic punishment, justice is tempered with mercy and must be guided by certitude. A tradition of the Prophet says that it is better to err in acquitting a guilty person than in punishing an innocent one. It would therefore be important that the crime be proven by a decisive event without any doubt, and that all the requirements of Islamic justice, which include a fair trail and the humane treatment of people in custody, be fulfilled.
Once proven, the guilty would probably find at least one mercy still available to them, even as they faced their punishment. While the judicial requirement must be met, a truly repentant person would be told that they could hope for God's forgiveness and mercy in the afterlife. As the Qu'ran frequently reminds the people who go to it for guidance, God is All-Forgiving, Merciful beyond boundaries, and Compassionate to those who seek it .