..but ultimately, the owner of the dog is at fault.
while that officer was clearly wrong for shooting the dog, the onus was on the pet owner to properly secure the animal when answering the door (esp for police).
service dog or not, the owner is responsible for ensuring the safety of his dog and the people around them. people aren't always aware of/comfortable greeting dogs, so you can't assume that everyone knows the protocol. the officer gave into fear and unfortunately the dog lost his life.