Restraint can certainly be one of the more practical and tangible purpose behind punishment in the criminal law. To remove a criminal from the midst of society and restrain him or her from committing further crime gives some immediate assurance to people that these crimes will no longer be committed by that criminal - at least for a while. And most people can agree that it's the responsibility of the law to physically remove dangerous criminals from society and to restrain them from committing further crimes.
The question is not so much whether dangerous criminals ought to be restrained, but which criminals are actually dangerous or damaging enough to warrant restraint, and for how long. An inveterate pick-pocket who makes a good living working Times Square probably presents a greater threat to society than a man who unintentionally kills his wife's attacker. Nevertheless, the pick-pocket will probably get out of jail (if he even goes to jail) sooner than the husband.
In addition to the relative danger of the criminal offender, while deliberating on whether and for how long he or she should be restrained the criminal law courts also consider the level of cooperation they receive. Someone convicted of petty theft who violates parole, or a drunk driver who repeats her offense, may require physical restraint in a correctional facility (incarceration). On the other hand, one time offenders who cooperate with the law and fulfill the requirements of their first punishment probably do not.
That restraint should be a part of punishment in the criminal law is hardly contested. Few would seriously argue that incarceration should be abolished. On the other hand, a strong argument is made against restraint when it fails to achieve rehabilitation. Without reforming criminal offenders during the time they are incarcerated, society often simply pays tax dollars to delay crime, rather than prevent it. Shy of instituting a policy of life-long incarceration for every serious criminal offender, this is a reality that criminal law legislators and judiciaries must address while determining punishments. It should be noted that the objection is not so much an argument against restraint as it is an argument for the importance of effectively rehabilitating criminal offenders.