Three cities have sued the U.S. Defense Department for repeatedly failing to notify the FBI about service members who committed crimes disqualifying them from purchasing guns. One such oversight enabled Devin P. Kelley to buy a rifle he used to slaughter 25 people, including a pregnant woman, at a rural Texas church in November.

The cities — Philadelphia, New York and San Francisco — are demanding court monitoring of the military to ensure proper operation of the reporting system from now on. The three are to be applauded for bringing attention to the military’s pattern of malfeasance and for insisting on maximum use of violence-prevention measures already on the books. Their efforts may save lives in their cities and around the country. As Philadelphia Mayor Jim Kenney said, an accurate database is “absolutely critical” to making good decisions about who should buy guns.

The Defense Department would be foolish to fight the cities in court. It should accept court monitoring without a fuss and finally do what it’s supposed to do to keep guns out of the hands of people who shouldn’t have them. If the military balks, a court should impose monitoring without delay.

When service members are dishonorably discharged or commit certain crimes, the Defense Department is supposed to alert the FBI so their names can be entered into a database that gun dealers must check before selling a weapon. Instead of giving this responsibility the fidelity it deserved and operating the reporting system with military-grade precision, the Pentagon consistently flouted the obligation.

Advertise with us

One lawyer for the cities said the flawed reporting dates back 20 years. But the sloppiness came to national attention in November, after Mr. Kelley, who spent time in the Air Force, methodically gunned down members of a small church congregation in Sutherland Springs, Texas. He had a record of domestic violence and other offenses that precluded him from buying guns. Because the military didn’t alert the FBI, however, his name never went into the database, and a gun dealer, through no fault of its own, sold a rifle to a person barred by law from buying one.

The laxness is puzzling because military officers should know better than most the dangers of letting weapons fall into the wrong hands. The military has acknowledged reporting lapses without adequately explaining the breakdown in discipline and policy that allowed them to occur. If their case goes to court, the cities should try to determine why the military gave the obligation short shrift.

The background check system works only when all of the parties play their roles. Across the country, court systems and police departments do their part to get civilian offenders entered into the database. Gun dealers do their part by contacting the FBI to make sure they don’t sell guns illegally. It’s time for the military to get on board, too. Military officers have been letting down the nation they swore to protect.