A DAY after 12 Navy Yard workers were killed in a shooting rampage, shock and sadness began to give way to anger and recrimination. How on earth could a former Navy reservist with a history of bad behavior, arrests and gun infractions legally arm himself and legally enter a military facility?

Scrutiny is critical to determine what role human or system failure may have played in Monday’s killing spree by Aaron Alexis, the 34-year-old military contractor killed in a shootout with police. Defense Secretary Chuck Hagel’s security review of U.S. military bases is prudent. Evaluating the efficacy of security clearances for federal employees and contractors is wise. The claim by Mr. Alexis’s employer that he wouldn’t have hired Mr. Alexisif he had known about his past indicts a process already called into question when National Security Agency leaker Edward Snowden used his top-security classification to steal sensitive government information.

Above all, Monday’s shooting should give urgency to efforts to enact more rational gun laws. No, we don’t yet know, as the investigation proceeds, what might have slowed or stopped Mr. Alexis. And, no, no law or reform could prevent every mass killing. But sensible protections would make it more difficult for the wrong people to get guns and for the wrong guns — which serve no law-abiding or sporting purpose — to be so readily available.

Mr. Alexis was a troubled person who had several run-ins with the law but was allowed to purchase a gun because he was never convicted of a felony and his mental issues didn’t disqualify him under restrictions imposed by a 1968 federal law. Only if he had been adjudicated to be mentally defective or had been involuntarily committed would he have been prohibited from purchasing a gun. Mental health has figured in other recent mass shootings: Jared Lee Loughner in a Tucsonparking lot in 2011 and James Eagan Holmes in an Aurora, Colo., movie theater to name two. But there is no mechanism in place that allows considered or expert judgment of who should be barred from owning a weapon. Someone who had been involuntarily committed and successfully treated may be a better candidate for gun ownership than someone under treatment from a psychiatrist who sees a danger. But the law doesn’t permit such distinctions.

In the aftermath of the last mass shooting that unsettled America — the slaughter of 20 Connecticut schoolchildren weeks before Christmas — the solution offered by the National Rifle Association (NRA) was to place armed guards in every school. “The only thing that stops a bad guy with a gun is a good guy with a gun,” said Wayne LaPierre, the group’s chief executive. There were plenty of good guys at the Navy Yard Monday morning, many of them with guns. They, and all the rest of us who live at risk because of Second Amendment zealotry, deserve political leaders with the guts to trade in the NRA’s nonsense for some common sense.

Read more about this issue:

The Post’s View: The Senate misfires on gun control

Eugene Robinson: Stop the gun madness

Eugene Robinson; Navy Yard shooting hits home

The Post's View: Congress should approve Manchin-Toomey gun deal

The Post’s View: Take a lesson from the Midwest on gun laws