It's called the felony murder rule. If a murder is committed in the commission of a felony, then everyone involved with the underlying felony are legally responsible for the attendant murder regardless of whether they had any involvement in taking the life.
Gambino associate Luigi Grasso and Bonanno mobster Richard Riccardi were convicted last March for the 2010 murder of Lucchese loanshark James Donovan during a botched robbery even though mob turncoat Hector Pagan was the admitted gunman, and Brooklyn federal judge John Gleeson made no apologies in sentencing them to 38 and 36 years, respectively, in prison as reported by John Marzulli for the Daily News:
"I understand that you think you were less culpable (than Pagan)," said Federal Judge John Gleeson. "I don't see any meaningful difference in blame that should be placed for the murder. You chose a life of crime. A man is dead. It's a natural consequence of the life you chose for yourself."
Pagan is best known as the ex-husband of Renee Graziano from Mob Wives.