Flags are waved at the National LGBT 50th Anniversary Ceremony in Philadelphia on July 4. (Matt Rourke/Associated Press)

As Americans gathered in cities across the country to celebrate the legalization of same-sex marriage, several thousand Turks also tried to march in support of rights for lesbian, gay, bisexual and transgender people.

Police in Istanbul attacked them with water cannons and rubber pellets.

The repression reflected the narrowing of freedom under President Recep Tayyip Erdogan; in past years, Turkey was the site of the largest gay pride marches in the Muslim world.

But Turkey is hardly alone in vilifying, isolating and threatening LGBT people. While 25 countries and territories now allow gay marriage, 75 nations treat homosexual behavior as a crime.

In 10 countries, it is punishable by death — and even where it is not, just being gay is often fatal. A May U.N. report found “continuing, serious and widespread human rights violations perpetrated, too often with impunity, against individuals based on their sexual orientation and gender identity.”

“Since 2011, hundreds of people have been killed and thousands more injured in brutal, violent attacks,” the U.N. High Commissioner for Human Rights reported.

What’s the right way to think about this global dichotomy? Overseas practitioners of bigotry sometimes plead for cultural or religious understanding: Just as they don’t tell us how to run our country, they say, we should show respect for their traditions. Of course killing transgender people is wrong, they might argue, but why should they be forced to legalize practices they find offensive?

You can hear similar arguments in defense of genital cutting, banning women from driving or keeping people with mental disabilities hidden away.

The appeal to a sense of tolerance may stop you for a moment, especially if you are loath to proclaim one faith or way of life superior to another.

But it shouldn’t stop you for long. Nations are entitled to organize themselves as they wish, but not at the expense of fundamental human rights.

A handy guide to this basic truth can be found in the Universal Declaration of Human Rights, which was adopted by the U.N. General Assembly — by the world — in 1948. It begins by recognizing “the inherent dignity” and “the equal and inalienable rights of all members of the human family.”

Is it respectful of the inherent dignity of every person to lock some up based on whom they love? To deny them protection of law, or freedom of expression and association? To ask those questions is to answer them.

Fortunately the world, like the United States, is moving toward an understanding of this truth. Until 1990, the World Health Organization considered homosexuality to be a “mental handicap.” On May 17 of that year — 17 years after the American Psychiatric Association came to a similar conclusion — it allowed that “homosexuality is not a disease, a disturbance or a perversion.”

Not until 2011, according to the Human Rights Campaign (HRC) advocacy group, did a U.N. political body affirm the equal rights of LGBT people.

Since then, the U.N. report notes, there has been progress: 14 countries have adopted or strengthened anti-discrimination laws; others have established hate-crime prosecution units, improved police training and data collection, or promoted anti-bullying campaigns.

But the progress is slow, the advances “overshadowed,” as the report notes, by continuing oppression, often grotesque violence and police indifference to such crimes — by what Secretary General Ban Ki-Moon called “one of the great, neglected human rights challenges of our time.”

“Data are patchy but, wherever available, suggest alarmingly high rates of homicidal violence,” the U.N. commissioner on human rights reports. Brazil, for example, “documented 310 murders in 2012 in which homophobia or transphobia was a motive” — and Brazil is atypical only in keeping track.

One striking pattern, as the HRC’s global director, Ty Cobb, told me, is that rights tend to advance in nations where democracy and civic participation generally are advancing and to retreat where dictators are gaining ground.

Although prejudice may be deep-seated, in many places the discrimination is recent, as authoritarian governments fan hatreds to distract people from their failures and keep themselves in power. The Islamic State kills and tortures gay people — but the virulently anti-Islamist military dictators in Egypt have been persecuting gay men and lesbians as well. Russian President Vladimir Putin was live-and-let-live during his first decade in power, but when Muscovites grew impatient with his autocratic ways in 2011, he turned to homophobia and “traditional values” to safeguard his grip on the Kremlin.

Like dictators from Uganda to Uzbekistan, Putin defends his bigotry as a rampart against permissive “Western values.” But there is nothing exclusively Western about respecting one’s neighbor. Russia and Uganda are signatories to the Universal Declaration, of which Article 1 should be more than sufficient:

“All human beings are born free and equal in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood.”

No appeal to tradition can justify hate.

Read more from Fred Hiatt’s archive, follow him on Twitter or subscribe to his updates on Facebook.