Not at all. A pilot that was a safety hazard on a flight does not deserve to fly. Simple as that. There is no excuse for causing a safety hazard risking 100+ passengers. Putting someone like this back into the cockpit would not be a wise decision. Safety is safety. Once compromised, it should be dealt with. Bad pilots that sacrifice safety should not fly for an airline. Even if it was an "accident" the gun still should have been properly stored, safety on, and not taken out of its harness unless needed for the safety of the flight.
A gun will not go off accidentally unless someone tampers with it. Any way for the gun to go off starts with a person. In this case it was the pilot of the aircraft. They require the proper training for a reason. That is for safety of or you and others on board the aircraft.
Sure the pilot is professionally trained to fly and has been flying for a while but he demonstrated a lack of safety with the gun he possessed by ignoring his previous training. That image doesn't work well with an airline, especially when safety is a concern for customers. There is a reason why the airlines look at your traffic records, it is the same deal. Breaking the law on the road could happen in the air. Firing a bullet through the airframe of the aircraft is just as bad. The cockpit is not the place for incompetence.