Punishemnt vs. Rehabilitation

Should criminal sentencing be oriented towards punishment or rehabilitation?
There are basically two lines of thought on what the goal of criminal sentencing (this means after guilt has been proven) should be: justice for the victim, which is usually used to mean punishment for the perpetrator, and rehabilitation for the perpetrator, which means working to make him a functioning member of society. Examples of policies favoring justice for the victim would include the death penalty, as it precludes the possibility of rehabilitation, and life sentences without the possibility of parole, for the same reason. Examples of policies favoring rehabilitation for the perpetrator include in-prison education for inmates, because the aim is to prepare them to find a job on the outside, reducing their dependence on crime and hopefully make them functioning members of society, and parole systems, because they allow for the possibility that if a convict can reform his ways, and has the possibility of functioning well on the outside, he should be released. There are of course, various compromises within those philosophies. One such mixture of philosophies can be seen in the minimum time requirements for parole; which state that inmates granted the possibility of parole must first serve a set number of years out of their sentence before they can be considered for parole. The idea of these minimum time requirements is to provide a deterrent while still allowing for rehabilitation. However critics say that there can be no compromise between these ideas, because if there is any immutable punishment, that contradicts the idea that if the convict is rehabilitated he is released, favoring a deterrent, which has nothing to do with the individual's possibility. So: do you think that these two concepts can exist symbiotically? If so, how? If not, which do you think we should abide by? As a side-note, all my examples are from U.S. law. I would be very interested to hear examples of these...