In the first place, we would like to anchor the basic concept that Islam never prescribes punishments haphazardly nor does it execute them without due consideration. Islam holds the balance of justice and insists on examining all conditions and circumstances connected with the offense. On studying a crime, Islam takes into account two considerations at the same time: the viewpoint of the criminal and that of the victimized community. In the light of such considerations, Islam prescribes the fair punishment that is in accordance with the dictates of sound logic and wise reasoning, and which must not be affected by wrong theories and national or individual whims.
In his book, Islam: The Misunderstood Religion, the well-known Muslim author Muhammad Qutb, states the following:
Islam imposes preventive punishments, which may appear cruel or coarse if viewed superficially or without proper consideration. But Islam does not execute such punishments unless it ascertains that the crime was not justifiable or that the criminal was not acting under any obligation. Islam prescribes that both adulterer and adulteress should be stoned but it does not inflict such punishment unless they are married persons and upon conclusive evidence by four eyewitnesses.
Moreover, the Prophet (peace and blessings be upon him) said: “Avoid the execution of punishments if there is doubt.” If we study the policy adopted by Islam in prescribing punishment, we realize that Islam tries in the first place to purify society from circumstances that may lead to crime. After taking such precaution, Islam prescribes a preventive and just punishment that may be inflicted on persons who have no reasonable justification for their crimes. Where the community is unable to preclude circumstances that may lead to crime or where there is some doubt regarding the crime, the punishment will not be inflicted, and the ruler will set the criminal free or he may inflict on him a light punishment (beating or imprisonment) in proportion to his extent of responsibility for the crime.
It is because some non-Muslims have not studied the reality of the Islamic concept of crime and punishment that they consider the punishments prescribed by Islam as barbarous and degrading to human dignity. They wrongly imagine that such punishments—like the European civil punishments—will be inflicted every day. They also fancy that the Islamic society indulges in daily executions of flogging, hand-cutting, and stoning. But the fact is that such deterrent punishments have been executed very rarely.

 Sheikh Ahmad Kutty, a Senior Lecturer and Islamic Scholar at the Islamic Institute of Toronto, Ontario, Canada, states: As Muslims, we are not allowed to tamper with the prescribed laws, but we have been allowed a certain amount of latitude in applying them…Also, we must take into account the fact that such laws are primarily instituted as deterrents, and they are rather hard to implement in ordinary circumstances because of the strongest regulations associated with them. For instance, in the case of the above punishment, four witnesses must testify and all of them must agree 100 percent on the details.
So do not consider the above laws as something to be applied in everyday situations. They are meant to be deterrents.

Based on what is mentioned above, Muslims are not allowed to tamper with the Divine Law or to start enacting laws based on their whims. When one studies the concept of punishment in Islam in depth, one will realize the true face of Islamic justice.