I notice the Rangers in US National Parks carry guns, but not for non-human wildlife. I have even seen backcountry rangers with heavy duty belts and service sidearms and cheerleader batons and government bug zapperz. Poor over-burdened functionaries. (Don't taze me bro!) (Editorial Comment: But us submitizens have nothing to worry about when our delegated servants take on the role of masters. The US Constitution, void where prohibited by law).
Risk assessment involves both probability and consequence. Whereas even most police officers in the US never draw their weapon in the line of duty, I think the probability of needing a gun is low unless you are a Stop-N-Rob store clerk or wear bacon scented cologne.
As other posters have noted, the utility of a firearm on a trekking trip is fairly low, and the weight opportunity cost is high. There are instances and places where it might be indicated for self-sufficiency and peace of mind, but it is low on the a-priori-ity list. On the other hand, when one needs a gun, one usually needs one very badly and very quickly.
Along the southern border for instance where drug smugglers have been known to attack those who come across their path, for fear of having their load ripped off. Organ Pipe National Monument is festooned with warning signs about wandering off into roadless areas that smugglers frequent.
In national parks and monuments it isn't legal to have an operational and accessable firearm. Consequently when this question is asked the informal 'don't ask, don't tell' mentality is likely to be invoked.
One reason people carry guns on hikes is because they live, work and drive in areas where being armed is a daily prudent habit, and like any piece of safety equipment a sidearm should be dealt with consistently and always under the control of the operator. Leaving one in a car creates a theft opportunity. When a gun isn't slung or holstered it should be in secure storage, which most vehicles aren't.
Having a gun no more makes one armed than owning a piano makes one a musician. Too many people approach guns as a magical talisman. Mindset, situational awareness, and disciplined practical training are the software that is more important than the hardware. A sane operator generally won't choose to go anywhere armed that he wouldn't go disarmed. That may not apply to US Marines.