A lot of history, as well as the dilemmas of the current world, can be summed up as part of a conflict within the Christian tradition. The same conflict occurs in other religions, and for atheists; I am choosing the Christian wording because it is as good as any, and most Americans have heard it:
Bible, Leviticus 24:19-20: "As he hath done, so shall it be done to him: Eye for eye, tooth for tooth." That is the supposed word of a god, speaking to Moses.
Bible, Mathew 5:38-39: "Ye have heard it hath been said, An eye for an eye and a tooth for a tooth. But I say unto you: That ye resist not evil: but whosoever shall smite thy right cheek, turn to him the other also." That is supposed to be quoting Jesus Christ himself, alleged only son of the one-and-done God.
Well, life is about learning, but when you are dead all your personal learning goes to waste. When I was around twelve my mother was mad at me after mass at Christ the King Church in Jacksonville, Florida. I actually don't remember what I did or said; I may have done something, like missing a beat during some part of the mass. Probably I answered some question of hers in a manner she called "talking back." In any case she slapped me hard on my cheek. It happened to be my left cheek, but in any case I turned the other cheek to her.
She went totally ballistic. Other churchgoers had to restrain her. I was lucky they were there, because my mother had been the only woman marine to actual kill a Japanese soldier in hand-to-hand combat in World War II. Any way, she calmed down, got me, my sister, and my brother (who thought this was terribly funny) into the family car, and drove us home. She did not report the incident to my father, as far as I know, or I would have gotten a second, more measured but more painful beating. My father had been in Marine Corps intelligence [unofficially still was, which is why he was not at Church that Sunday morning with us: he was at his "civilian" job at Sea Land, providing logistical support for the attempt to "recover" Cuba], and knew how to inflict severe pain on people without leaving marks. As he proved many times in domestic life.
So I am basically a turn the other cheek guy, and became a draft dodger and peace protestor during the War in Vietnam, but I can understand anger. I can understand the desire for justice.
The real world is a complicated place. It should not be surprising that after about 3 centuries of post-Jesus pacifism, when the Christian cult had grown large and become the only legal religion within its old enemy, the Roman Empire, turning the cheek began to lose ground. With everyone now a Christian, of course that meant that the criminals were Christians, and businessmen, and power-hungry men. Dial forward to, say 1000 A.D., and Christian armies were fighting Christian armies on a nearly-continuous basis.
There is a split-down-the middle approach that works well in many situations: self defense. When I was older and bigger, age 17, finally when my mother went to slap me I just grabbed her wrist and pushed it back down. Strangely, that was the end of her beating up on me, my older brother (who went on to become a Marine Corps Colonel) and (I believe) my younger sister, though Mother found other ways to try to control us.
Unfortunately often people are unable to defend themselves, even when they try. Or the losses are tragic, as with the Philippines unsuccessful attempt to defend itself against U.S. aggression, or the Vietnamese ultimately successful defensive tragedy, or innumerable other such wars within even just the memories of those currently living. Self-defense requires resources on par with those used by aggressors.
Regarding Dzhokhar Tsarnaev, the junior member of the Boston Marathon bombers, I think the ethics of the situation are clear, but complex. This was not an ordinary crime, but was part of the War Against Fundamentalist Islamic Groups Not Aligned With the U.S. [because the nation of Saudi Arabia is very fundamentalist, but is aligned with the U.S., so we don't fight them. And for that matter the government of Syria is not fundamentalist, but it is not aligned with the U.S., so there is no good description, except maybe the Pentagon's War to Justify Its Budget].
Prisoners of War (POWs) are to be treated humanely under International Law. They can be held until the war is over, then they must be released. This can be difficult for soldiers in the heat of battle. One moment a guy is trying to kill you, the next he is a POW with human rights. It is hard to remember the rule is reciprocal: you were trying to kill him, if you were captured you'd be the POW with human rights, that hopefully he would honor.
So is Dzhokhar Tsarnaev a POW? I would argue yes. So he should be held in prison until the war is over, which will likely be never.
But International Law also says that militaries purposefully or negligently killing civilians is a war crime (or a crime against humanity if in a non-war context). And Dzhokhar Tsarnaev and his brother did not pick a military target. They purposefully chose a civilian target.
Which is back to eye-for-eye. The United States has never hung any of its own soldiers, much less our Commander in Chief, for killing civilians. And we have killed a lot of them, from American Indian tribes (which admittedly was before modern War Crimes treaties were signed) to Japanese to Vietnamese to Iraqis and Somalis and now Syrians.
Under eye-for-eye, it's okay to behead Dzhokhar Tsarnaev. Under war crimes law, it is okay to behead Dzhokhar Tsarnaev. Under U.S. law, probably another method of execution would be used.
But any form of execution would create another martyr for the crazy-ass interpretation of Islam. It won't do anything to curb the similarly crazy-ass interpretations of Judaism and Christianity.
It won't do any good at all. The most pragmatic thing to do is to get Dzhokhar Tsarnaev to become a peace worker. Let him tour around telling high school students not to be lured into violent cults, like the U. S. Marine Corps or I.S.I.S. Let him tell them to turn the other cheek whenever possible, and to not make self-defense into an excuse for aggression, as so many people are doing today.