There are more reasons than bad guys have guns.
Bad guys follow no rules. They can be armed with a four inch knife, but if they hold that up to the throat of a hostage, tear gas will not deescalate the situation. Bad guys are able to create a plethora of situations where police can best respond with firearms.
Also, comparing the US with other countries is nonsense. There just isn’t any equal comparison.
We have a different size than other countries, a different cultural diversity, a different history, different politics. We may share one or two similarities with most or all countries, but we don’t share enough points of similarities with any country to ake a comparison.
In the US, cops carry firearms because it is at times necessary.
It is true that sometimes cops reach for the wrong tool on their utility belt, but that does not need whatever the fact that at times, that tool is needed.
It is a shame things went a bad way with the man who lost his life. I am unfamiliar with the particular story, so I don’t know if lives were at risk from him or not. Sometimes enraged people can’t be stopped without firepower, because of drugs or adrenaline.
Cops carry firearms for the same reason they use robots to check for bombs, or to look in at a possible hostage situation. The public has to be protected from the bad guys, and because bad guys operate in a variety of ways, a variety of tools must be available to law enforcement.
Think about the term law enforcement. Societies have rules they depend on for conducting their lives. Law enforcement is there to keep laws from being just an ideology. Law enforcement is there to give those laws teeth. A law works only if there is someone providing consequences for ignoring the law. Sometimes that enforcement is imperfect, and when that time happens there should be consequences for that. We should never, however, try to convince ourselves that there is no need for enforcement.