There are times when a handgun is a very appropriate response to a dog.
That said, spray and sticks have one major advantage (and not just from the dog owner's point of view): they almost eliminate the possibility of collateral damage.
Glenn Dee said his accuracy was stellar because the dog was latched onto his gun belt. That was an entertaining way of saying he probably wouldn't have scored so well against a maneuvering dog - which is probably true for most of us. In such a case, where are those rounds going?
If I inadvertently spray somebody, unless they have a serious allergic reaction, it won't really harm them. Annoy them, yes; debilitate them (for more than several minutes), no.
I could possibly hurt somebody pretty badly with a walking stick, but the odds of a bystander being inside its sweep are pretty slim - with the exceptions of another victim I'm trying to help, a good samaritan trying to help me, or the dog's owner trying to corral the dog. Even then, the odds of my scoring a full-on hit on the other person aren't that high.
Bullets, on the other hand...
So, a lot might depend on where the incident occurred.
And it's never bad to have options. In the Navy, we called that concept either a "layered defense," or "defense in depth."