I think it will usually be justified as being in the imminent defense of others / the public. The sniper was actively threatening to continue shooting people.
Perhaps they’d say the hypothetical guy shooting at a robot is endangering others via any stray bullets. And perhaps sometimes that would be correct.
Maybe ten minutes before, perhaps ten minutes after.
But perhaps they could have cordoned off a wide area until he got hungry or thirsty enough to come down. That would have been a massive hassle for the city and difficult to ensure the city’s safety but you could always blow him up next time he starts shooting at someone.
On balance obviously it was expedient to blow him up at that moment but it’s not clear it was strictly necessary.
I get that cops can't be trusted to only use it in this scenario (as implied by the author), but if hypothetical "better police officers" were available, should we allow it then?
EDIT: theoretically the robot (even if remote controlled) could aim better.
Emphasis mine. Is it not okay to shoot at someone who's shooting at your partner?