Even if they were acquitted on the ludicrous charge of “debauchery,” the 26 Egyptian men on trial in the government’s latest crackdown on gays are likely to suffer a lifetime of public scorn.

Over the past two years, there has been no shortage of travesties and injustices in Egypt’s courtrooms. The country’s ousted dictator, Hosni Mubarak, was sentenced to life in prison in 2012, lying on a stretcher placed within a cage, only to be acquitted two years later in a subsequent proceeding once his allies were in power again. Mr. Mubarak’s Islamist successor, Mohamed Morsi, who was removed from power in a military coup, was locked up in a soundproof cage at his trial last year. Three journalists employed by the Doha-based Al Jazeera English network were outrageously sentenced to lengthy prison terms in June on allegations that they had aided the Muslim Brotherhood, following a ridiculous trial that turned them into scapegoats of a fight between Egypt and Qatar.

The trial underway now seems particularly cruel. On Dec. 7, Mona Iraqi, a television journalist who works for a pro-government channel, barged into a traditional hammam, or bathhouse, in Cairo, to document what she billed as “the biggest den of group perversion” in the Egyptian capital. The police, operating in concert with her, promptly raided the establishment. Ms. Iraqi posted photos of naked men being corralled by authorities and promised viewers, in a since-deleted Facebook post, that her exposé would feature the “whole story of the dens for spreading AIDS in Egypt.”

The Egyptian government has persecuted gay men with varying degrees of intensity over the past two decades. The latest crackdown has driven the gay community underground like never before. It is not entirely clear why Egypt’s military leaders have ordered, or condoned, the prosecutions of men accused of being gay. In a deeply conservative Muslim country, demonizing sexual minorities has served in the past as an effective way of deflecting attention from actual problems the state has failed to fix.