God may have to punish in this world to restrain sinners but that is only necessary because of the kind of world it is. People are able to harm and thus what cruelty they do is dealt with after it happens.  He could make another world and populate it with people in force fields where nobody can harm anybody else.
Punishment is certainly an evil. It is not a nice thing even if it is necessary. It does not change the evil inside the person unless the person decides to change so it is really the person who can change. Punishment may educate and inspire change but these things can be done without it. Though it is good to try and convert through punishment on earth - when we have to punish we may as well try to change the person through it - punishment is adding the evil of suffering to the evil in somebody's heart and the evil they have inflicted. It doubles the evil. It is worse to commit theft in a country that will jail you for it for then you are not just committing the evil of theft but committing the evil of pulling evil on yourself by the risk of jail. Theft is not so bad where you will get away with it as long as you stop doing it.
God should make it possible for the person to have the bad intention but do no harm with it for he makes it possible for the person to evade any punishment by repentance.  Though it is good to will the punishment of the evil in the person on paper it is bad in practice. There is some sense in saying the person should be punished but there is not enough sense in it to justify punishing. To make sense of this perhaps this parable will be of assistance: A man murdered his lover in cold blood. He deserves death becauseshe killed him. That is pure logic. But it does not mean we should kill him. One way it does but because you cannot destroy a person for a person is valuable even after they take a life so you cannot do it. This implies that the welfare of the person is more important than punishing them. The person comes before the punishment. It implies that God has no business punishing anybody once they leave this world and certainly that he has no right to punish people forever in Hell. If the person is absolutely valuable then it follows that every moment of that person's life is as well. Therefore the person deserves only happiness in this world and in the next no matter what he or she does. Yes she or he does deserve to suffer but this deserving is blanked out by the treatment she or he deserves as a person. The doctrine of Hell which Jesus called eternal punishment shows a lack of moral sense among the Christians and just how abominable many of their doctrines are. God is an evil doctrine because it implies that a cosmic fuss should be made over the hidden and harmless but evil intentions of the heart.

If punishment is so faulty then it is worse to hurt a person to reform them. Why? Because if the punishment is bad though they ask for it and deserve it then to hurt them without thinking of what they deserve is worse because if it is bad to give a person what pain they deserve, it is worse to give them pain that is not concerned with what they deserve. This reasoning is based on the free will defence. The free will defence teaches that God gave us free will and we abuse it so evil is not his fault. Because we do bad we deserve evil. So when we suffer it is not that God wants to reform us, it is that he wants to punish us.

Religion has to say that if evil is for a divine purpose then it follows that all suffering is rooted in punishment and that is its prime purpose.  It may think that even if it does not have the courage to say it.