A minimum wage security guard carries a gun while guarding a few thousand dollars cash in transit ,why shouldn't a pilot guarding hundreds of lives and the possibility of billions, not millions ,of dollars worth of potential consequences be armed as well ?
Sure there are problems with security of weapons,local laws ,training etc ,but since the attacks in America the whole world has changed.
A pilot used to be allowed to carry a gun while flying in Papua New Guinea ,I'm sure anyone who has ever flown there knows why.