In the wake of 9-11 the flying public in the USA wants the highest security possible. Arming pilots adds a level of security. About two-thirds of Americans are in favor of arming airline pilots (68%) according to a recent
Gallup poll.
If you can trust a properly trained pilot with a B-747, you should also be able to trust a properly trained pilot with handgun.
I like a .380 for cockpit defense.