Well, we do have sentencing guidelines, and we follow the law.
Science can certainly give you hard information (like cost, health of the inmate, odds of successful reinsertion into society, all of the above, etc) so you can inform those laws when they're made or modified. Unfortunately, that's normally has not been the case, and thus we have a serious incarceration problem in this country. But to your point of right or wrong, science will only go so far as to determine what's fact and what's fiction, and sometimes it won't be able to, for the time being, and the answer will be "we don't know yet". What's the distinction? Well, when somebody claims the sun's color is green, we can certainly state they're not right. Now you could give me the argument that this person is color-blind and he sees the sun green, and thus he's "right". But this person and us, we don't live in two different universes. We know what the color of the sun is, regardless of how he perceives it. So when it comes to right or wrong at a personal level, my policy is, believe whatever you want. When you try to stretch that to everybody else, hold that horse.
Lastly, as I pointed out, sometimes science doesn't have an answer just yet. We're still looking to verify some answers from Einsten's theory of relativity, for example, as technology evolves. But sometimes answers can't be delayed (sentencing example above), so we then move to pragmatism. And frankly, unless it's somewhat informed by actual data, history or experience, it's mostly made up on the spot. I mean, you ask that same question you're asking science to 5 different people that are not lawyers or judges, and you're probably going to get 5 different answers. At that point, we're making up, with no rhyme or reason.