In 1999, a former mayor of Istanbul named Recep Tayyip Erdogan was imprisoned and banned from politics for life for reciting a poem. “Our minarets are our bayonets, our domes are our helmets, our mosques are our barracks,” the incriminating lines went. “My reference is Islam. If I am not able to speak of this, what is the use of living?”

The ban on Mr. Erdogan didn’t stick. Now Turkey’s president (and prime minister for 11 years before that), he is presiding over a nationwide purge of suspected enemies after the failure last...