He shot him 9 times because that was all the bullets the gun would hold. When someone is trying to kill you you must do all you can to eliminate the threat, as long as the perp had a gun in his hand he was a threat, the shooter had no way of knowing the gun was only a BB gun. The shooter did society a favor. The robber had already killed once before, he won’t do it again.
My issue with the shooter is that he should have reloaded. No guarantee that the perp didn’t have help outside.
Yes, he did society a big favor and now he’s going before a grand jury to find out if they agree with you or not.
There's a related thread where all nine shots are shown; discussing the nine shots without seeing the nine shots is pointless. (You would have known that the shooter had already picked up the perp's gun before he fired the last round.)