President Trump just struck a moral blow against U.S. government bureaucracy.

He did so by ordering the State Department to grant emergency visas to six Afghan girls.

The girls will now be able to join the FIRST Global robotics competition that begins this Sunday in Washington, D.C. The competition will feature national teams of high schoolers from 163 different nations. They will compete to show the best innovative use of robotics to produce clean drinking water.

In short, the competition is a great cause that promotes both the study of science and math, and the possibility of new ways to address a critical humanitarian need.

Yet without Trump's action, the Afghan girls' team might never have made it.

That's because in a stunning act of State Department incompetence, the U.S. embassy rejected two different visa applications for the girls to travel to Washington. The team had twice traveled hundreds of miles along the dangerous road to Kabul to seek those visas.

The embassy has refused to comment on why it refused the applications. But what could it say? Its failure to do so is inexcusable. After all, a central U.S. mission in Afghanistan is the promotion of civil society. That obviously entails the advancement of girls' and womens' rights. This is a special concern in Afghanistan, where the Taliban and other Islamist groups seek to keep women in full-covered burqas.

Correspondingly, whatever rationale the embassy might have had, it made the wrong judgment. Whoever is in charge of the visa section at the embassy should be fired.

Fortunately, the president has stepped in to do the right thing.

Speaking to Reuters, one of the girls, 14-year-old Fatemah Qaderyan stated "We were disappointed, and we were feeling bad, but now. .. we are so happy for the support of the Americans and Mr. Trump, and we thank them for providing us visas to allow us to travel and attend the competition."