America’s young male killers, who glory in indiscriminate slaughter, are a Western eruption of a larger phenomenon. What’s often called “stateless terrorism,” or deadly extremism by individuals and groups, could as accurately be described as a male crackup. This convulsion has been most acute in the Muslim Middle East, where modern authoritarianism has bulldozed the past, freeing young men from once-powerful social constraints and exposing them to a radical religious rebellion. America—the relentless engine of innovation and change—now also faces an outbreak of disconnected young men murdering exuberantly.

It takes relatively few men running amok, if they use the right type of violence, to unhinge communities. Men have an extraordinary, renewable capacity for violence. It can be aimed or aimless, redemptive or nihilist, solitary or fraternal. “Crazies” reveal what warriors often only reluctantly admit: Killing is exhilarating. With young men, in whom passions are immediate, it can be addictive.

Islamic civilization has been plagued by extremely violent young men since the 1970s, and contrasting these murderers with our own offers insights that help illustrate what the U.S. is confronting. Muslim societies—particularly in Arab lands—have had an enduring crisis of legitimacy and patriarchy since World War II. It’s not a coincidence that jihadism has been particularly barbaric against fellow Muslims in societies like Iraq, Syria, Algeria and Egypt. There secularizing rulers stamped out local hierarchies that preserved mores of the older, more cosmopolitan men who ruled the Ottoman Empire.

Murderous Muslim militants, like America’s most dangerous young men, feel destiny if not righteous wrath behind them. They cut out the collective memories that showed kindness and consideration to women and children, even if infidel. Beheading or raping foreigners because they were unbelievers—once unthinkable to men raised in Ottoman traditions—became halal, or permissible. Not that long ago the Middle East was more welcoming to homosexuals than the Christian West—the profound Muslim sense of privacy, and the eclecticism and tolerant hypocrisy that comes naturally to ancient imperial cultures overrode the holy law’s severe sanctions against same-sex relations.

Youth in the Muslim Middle East live increasingly without men or institutions they respect. Young men are ever more modern in that they have a sharpened sense of who they are as aggrieved individuals; their faith is deeply politicized. Their surrounding culture has been in rapid transition, simultaneously becoming more Westernized—an Americanized global culture is everywhere, creating almost daily new temptations and offenses—and more religious. The orthodox hang on tightly and the militant spew forth a seductive, lethal hatred against those forces, foreign and domestic, that they see as controlling their lives.

Omar Mateen, who killed 49 in the Pulse nightclub, was born in America. Minus his radicalized Islamic identity, he was surely not that different from the “white nationalists” who gun down blacks, Hispanics and a lot of Caucasians. Descriptions of jihadists ought to echo loudly for anyone looking at America’s worst non-Muslim killers. Mateen was out of control, with a negligent father and without a circle of men who could guide him from self-destruction. He found militancy online, in the “global ummah,” that imaginary community of believers under siege, and perhaps more personally on a trip to Saudi Arabia.

The scariest issue in America isn’t guns, though perhaps we’d have fewer dead if the Second Amendment didn’t exist. Guns have always been plentiful in the U.S. Young men killing strangers in large numbers for sport have not. The overwhelming problem is that the socialization of young males is failing. This has been true among African-Americans since the 1960s, when black-on-black violence began to soar to small-war levels. But young black men, perhaps because they are a deeply rooted minority, have not seen this killer instinct escalate to indiscriminate mass slaughter. Young men gunning down other young people at schools or shopping malls appears to be distinctive to the dominant Euro-American culture.

The U.S. has become perplexed by female empowerment and the foulness of piggish men; it ought to be more concerned about young men who so easily kill women and children despite the traditional male imperative to protect them. Historically, the only thing that stops such young men is older, stronger men, who compel emulation through example, love and coercion.

It’s hard to envision scenarios in which the Middle East gets put back together, in great part because its dictatorial politics are so brutal, and because multigenerational patriarchal families, once a hallmark of Muslim society, have been badly fractured. Too many young men are susceptible to calls for extreme violence.

The U.S. is obviously in vastly better shape. American problems with modernity will likely always be less intense since America is the primary progenitor of “progress,” and our democratic politics allows deep passions to be released in electoral combat. But we are absorbing change less successfully than we used to. The dynamic genius of the West, its unrelenting individualism—which feeds both world-altering ambition and atomizing anxiety—unavoidably leaves a lot of collateral damage.

We shouldn’t ever think that social collapse can’t happen here. Not that long ago, Westerners could travel the Middle East more safely than they could in many areas of the U.S. When things give way, when the dark force rises in men, hell is never far away.

Mr. Gerecht, a former CIA case officer, is a senior fellow at the Foundation for Defense of Democracies.