Recently I saw Heinz's dilemma and actually I found that none of the actions or purposes is really wrong or right to me. But I found that punishing (e.g. imprisoning) Heinz (in the case he steals the drug) would be wrong to me.
Although my ethics do not answer whether he is wrong, various theories do (some can say it will lead to good consequences, therefore he does right action, and some can say it is violation of duty). But I hardly can understand what these theories suggest to do with those whith peoplr who were "right" or "wrong".
Therefore I'm wondering now if the question of punishment (and reward) lies within ethics. If so, what is the ethics branch studying it?
It sounds like you have a special interest in imprisonment, so here are a few comments.
Actually, imprisonment is punishment, because it is done with the hope
to change human behavior.
Not necessarily. People can be imprisoned as a form of punishment, period. Solitary confinement and life sentences, in particular, do little to improve behavior.
People can also be imprisoned, albeit rarely, for their own protection, for observation or pending further legal action.
Keep in mind that the justice systems in some countries (e.g. the U.S.) is extraordinarily corrupt. The U.S. is known for the vast number of citizens who are in prison, along with a variety of abuses associated with prison.
Torture (not limited to solitary confinement) and rape occur in some prison systems. Innocent people can be sentenced (sometimes knowingly) to prison.
The most familiar legal loophole is the common knowledge that rich and powerful people are the least likely to be sentenced to prison. When they are sentenced, they typically get shorter terms and may be sent to special "country club prisons."
You might also want to do some research on political prisoners, juvenile detention, etc.