In Islam...
In Islam, worship of God is not set up as something separate from morality and justice. To illustrate this point, here is a question. Where in the world have you seen a guilty person come forth voluntarily for punishment? A guilty person usually flees from justice. The only force that can make a human being voluntarily submit to punishment is faith. We see many examples of this in early Islam. Islam has envisaged punishment for all sins, such as drinking, adultery and theft.
At the same time it says, "Punishments are abandoned with the slightest doubt." Islam does not compel a judge or governor to seek out a guilty person; rather it places an urge within a guilty person to come forward for punishment. This kind of thing often happened in the time of both the Prophet and Hadrat Ali. A man would come before them begging to be punished in order to purify himself. A man came to the Prophet, confessing adultery.
In such matters the confession should be repeated four times to be credible. The Prophet said, "Maybe you mean you kissed her?" The man said, "No. It was adultery." The Prophet said again, "Perhaps you only gave her a pinch, " hoping again that he would say ,"Yes," and he would then be pardoned. But the man gave a negative answer.
This dialogue went on until it was quite clear that adultery had been committed and the man begged for punishment in order to be relieved of punishment in the next world. There is another case of a woman who came to Ali, peace be upon him, and said, "Oh Commander of the Faithful, I am married and in the absence of my husband, I have committed adultery and I am now pregnant. I wish to be purified from my sin." Hadrat Ali said, "One confession is not sufficient.
It should be repeated four times." Then he said, "The punishment for the adultery of a married woman is being stoned to death. If you are dealt this punishment, what happens to the baby in your womb? The baby has done no wrong and must not be stoned. Go away until your baby is born." After a few months, the woman came again. This time with a baby in her arms and asked to be purified since the baby was born. This was her second confession.
Again Ali, peace be upon him, said, "We might stone you but this baby is not guilty. It needs milk and a mother to nurse it.