The premise of Texas law is that individuals who are in the commission of a crime give up certain rights, including the right not to be shot and the right to blame the guy that's with you if someone dies while you're committing a felony.
It's called accomplice liability, and lots of states have it. One of my personal faves is "felony murder", where you're on the hook for murder if anyone croaks, for any reason, while you're doing a felony. For example, you stick your finger out in your pocket to pretend you have a gun to rob a 7-11, some old coot back in the dog food section doesn't even see you, but keels over of a heart attack... You're going down for murder one! How can you not love that?
Gotta Love Texas!