A few weeks ago, U.S. Secretary of State John Kerry flew to Cairo to say that the roadmap Egypt's military rulers have set out for a return to democracy was moving "in the direction that everybody has been hoping for."

I have three words for Kerry: Jailed teenage girls. And a few more: Egyptians just lost their right to protest. Kerry's statement was puzzling at the time. Now it looks embarrassing.

Today, an Egyptian court sentenced 21 women, who had taken part in a protest to support former President Mohamed Mursi, to prison sentences of up to 11 years. Seven of the women were under 18. They didn't hurt or kill anyone, in a period when more than 1,000 people were killed. Nor did they rape anyone, unlike during the protests against Mursi that led to his removal, when dozens of women were raped in the crowds.

Still, the women were convicted of belonging to a terrorist group, sabotage and other crimes, such as obstructing traffic. This is Orwellian stuff, precisely what you would expect from a military junta -- but not from an institution committed to restoring Egypt to the path of democracy.

In the protests and camps the Muslim Brotherhood organized to support Mursi after his fall, women and children were a huge feature. As a visiting journalist, I never felt threatened among these crowds. I didn't meet the women and girls jailed today, but I met many like them. I found their worldview extremely misguided, but to jail them as terrorists is grotesque.

Moreover, the military and its secularist supporters have based the legitimacy of the July 3 coup on the assertion that an overwhelming majority of Egyptians supported the move. This was uncertain at the time (who was counting?), and now appears to have been untrue. An opinion poll by Zogby Research Services LLC shows that 51 percent of Egyptians believe the removal of Mursi was wrong, compared with 46 percent who supported it.

Today's convictions come on the heels of a new law that restricts the right of Egyptians to protest, requiring government permission for any gathering of more than 10 people. The law is clearly designed to help the military in its battle to suppress the continued protests by Mursi's supporters, but it has triggered alarm among civil-rights activists. Very soon, civil liberties in Egypt will be more constrained than they were under former President Hosni Mubarak.

It would be naive to suggest that the U.S. or any other country should conduct its foreign policy solely on the basis of who plays nice to its citizens. But there needs to be a very clear upside to giving a pass to a coup of this kind. Right now, that doesn't seem to be the case in Egypt.

(Marc Champion is a Bloomberg View editorial board member. Follow him on Twitter.)