They don't have those purposes at all. Bullets kill, destroy, and threaten. It's just that people mistakenly blame the gun. As I said before, guns are not evil. They can be loaded with rubber bullets to take down a dangerous criminal without hurting anyone, or they can be loaded with powerful tranquilizers so that bears won't be able to [completely] maul you to death next time you get drunk and fall into a bear den at the zoo.
All in all, if guns didn't exist, there would be a lot more bear maulings.
Guns are designed to kill, period. That's why they were invented, and that's why people typically carry them.
That's not the reason that fire extinguishers are put on walls and throughout buildings.
Think of it this way -- why aren't there guns attached to the wall throughout buildings, with a little sign that says "break in case of emergency"? Because they're inherently dangerous.
And that's why guns are paranoia while fire extinguishers are preparedness.