Judges passing the death sentence The Yodhajiva Sutta tells the story of a warrior who thought that brave warriors who fought valiantly and died heroically on the battlefield, would go to warrior heavan. The Buddha disappointed him by saying:


  When a warrior strives &amp; exerts himself in battle, his mind is already
  seized, debased, &amp; misdirected by the thought: 'May these beings be
  struck down or slaughtered or annihilated or destroyed. May they not
  exist.' If others then strike him down &amp; slay him while he is thus
  striving &amp; exerting himself in battle, then with the breakup of the
  body, after death, he is reborn in the hell called the realm of those
  slain in battle. But if he holds such a view as this: 'When a warrior
  strives &amp; exerts himself in battle, if others then strike him down &amp;
  slay him while he is striving &amp; exerting himself in battle, then with
  the breakup of the body, after death, he is reborn in the company of
  devas slain in battle,' that is his wrong view. Now, there are two
  destinations for a person with wrong view, I tell you: either hell or
  the animal womb."


What about judges who carry out their judicial duties correctly and pass the death sentence according to the law?

Would these judges suffer the same fate as the warriors above, or not? And why?

Is it right livelihood?
Yes, and it's good to compare it to that quoted story, as many think that for a "higher, nobler" aim, doing wrong is ok. Or out of duties, like moderators and "responsible" often think.

Not only doing by oneself, but also order by words or sign and mental approve (which is the heaviest) are the doors of action (kamma).

Not even the judge, but also those who install such as death sentence inlaws, order death sentence, or mental agree face the results of the kamma of killing. So one should be careful also when voting or watch news of "bad-mens-hunts".

Always good to address here is the Dhanañjani Sutta in regard of duties.


  "What do you think Dhanañjani? There is the case where a certain person, for the sake of his wife &amp; children ... his slaves &amp; workers ... his friends &amp; companions ... his kinsmen &amp; relatives ... his guests ... his departed ancestors ... the devatas ... the king, does what is unrighteous, does what is discordant. Then, because of his unrighteous, discordant behavior, hell-wardens drag him off to hell. Would he gain anything by saying, 'I did what is unrighteous, what is discordant, for the sake of the king. Don't [throw] me into hell, hell-wardens!' Or would the king gain anything for him by saying, 'He did what is unrighteous, what is discordant, for our sake. Don't [throw] him into hell, hell-wardens!'?"
  
  "No, master Sariputta. Even right while he was wailing, they'd cast him into hell."


Is it right livelihood?

Ordering death is no right livelihood, spoken in regard of the main question.

"But": There is nothing total wrong which the work as judge, althought surely not very conductive for the practice. Remember the devoted King who gave up judging and passed it to his servants, having faced than "noble" people are capable to lie for sensual pleasure.

The work as someone who orders the physical harm or even depriving from life, or depriving of own, is of cause wrong livelihood, at least at the moment he makes use of the power for such. So it might depend much on the law he has to execute itself as well.

Same as doing soldier is not perse wrong, but only if not firm abstaining from killing.

(Note, not given for trade, exchange, stacks and notorious doubter by for those after firm stand upwardly and toward liberation)