He did deserve to get shot. Or at least, he was responsible for putting himself in a situation where him getting shot was the most likely outcome.
Pro tip: if you're trying not to get shot, don't attack people holding semi-automatic weapons for no reason.