Story highlights Frida Ghitis: Supreme Court rulings on gay rights resonate around the world

She says they help restore America's role at the vanguard of personal freedom

Ghitis: Many countries still harshly publish homosexuality

She says U.S. has strayed from its role at times but it's appropriate to return to it

America's right place is at the vanguard of the quest for freedom and equality. The country was founded on that principle, as a nation whose very identity is built on equal rights and true freedom for its citizens. Wednesday's twin decisions by the Supreme Court in favor of gay equality allowed the country to move closer to its founding ideals.

That is not just good news for gay Americans, for their families and for the United States. It is excellent news for the cause of freedom and equality around the globe, and not just for gay people.

What happens in the U.S. matters. It influences views everywhere. That's why when the high court ruled that the federal law perversely named the "Defense of Marriage Act" or DOMA is unconstitutional and allowed the anti-gay marriage Proposition 8 in California to be struck down, the news rippled to all corners of the world.

You can be sure the news brought smiles to faces in the Middle East, in Africa and elsewhere.

Frida Ghitis

The U.S. is hardly the first country to have laws and court rulings in favor of equality for gays. In fact, America has fallen far behind in what is now a worldwide movement -- and there is a very long way to go before gays in America can claim they are treated equally, if only by the law.

The Netherlands was the first country to fully legalize gay marriage. It did it without much fanfare in 2000. Since then, more than a dozen countries have followed suit. Gay couples have marriage equality in all corners of the world, not just in liberal Scandinavian nations such as Denmark and Norway, but also in Latin America -- in Brazil, Argentina and Uruguay -- and as far away as South Africa and New Zealand.

Most of the world, however, is not as open to equality. As recently as last year, Iran executed young men by public hanging. It is one of several countries where homosexuality is punishable by death. In many other places, the punishment is prison. In many more, there are intense legal and social restrictions.

JUST WATCHED Did Supreme Court make history or not? Replay More Videos ... MUST WATCH Did Supreme Court make history or not? 01:45

JUST WATCHED Scenes of joy after Supreme Court ruling Replay More Videos ... MUST WATCH Scenes of joy after Supreme Court ruling 02:40

In Uganda, the names and addresses of gay activists have been published in the local media, triggering violent attacks, and a pending law would impose life imprisonment for gays and up to three years for anyone who knows and fails to report homosexuals. American evangelists have promoted the crackdown.

In Russia, just this month the Russian parliament passed a law banning "propaganda of nontraditional sexual relations." Gay rights demonstrators have been brutally beaten in what has almost become a ritual in Russia and elsewhere.

Despite intense and often well-founded criticism of the United States and complaints that its rhetoric doesn't match its behavior, America wields enormous social, cultural and political sway around the planet.

The court ruling on same sex marriage will be read carefully by some jurists in some countries. Its words may find their way to other rulings.

Other people will read just a few key words.

The DOMA decision by Justice Anthony Kennedy centered on one of the most fundamental concepts of democracy: the notion of equal protection. The ruling articulates an idea that will resonate in the many nations struggling with internal divisions and just learning the meaning of democracy and freedom. Kennedy spelled it out. A government cannot simply deny equality; it cannot treat one group of people differently without a legitimate purpose.

Most people will only see a headline. They will see pictures of celebrations in the United States. They will hear that in the United States gay couples can now marry. That is not quite correct. In most U.S. states same-sex couples cannot marry, although some experts believe the language of the Kennedy decision provides the arguments that will soon make that possible.

Kennedy, the court, the activists and lawyers who brought these decisions may not have thought much about the rest of the world when working on this case. But the whole world was indeed watching.

The whole world started watching a long time ago. More than 300 years ago, Thomas Jefferson appealed to an international audience when he wrote the Declaration of Independence. In the very first paragraph he said "respect to the opinions of mankind" was the reason why Americans had to spell out their decision to break free from the British.

"We hold these truths to be self-evident," he explained "that all men are created equal." And he added that government is created for the purpose of securing unalienable rights, including "Life, Liberty and the Pursuit of Happiness."

That is the essence of America, and it is the reason why the country has exerted such a powerful appeal to those seeking freedom over the centuries.

The U.S. has very plainly strayed on many occasions from that path it so highly charted for itself. But the country has also shown a remarkable ability to correct course because its people have never become so jaded as to forget those founding ideals.

One reason America has succeeded for centuries in staying at the forefront of history is that history, as Georg Hegel said, is the unfolding of an awareness of freedom. A country that stands on the side of freedom and equality is inevitably a country on the right side of history.

With the two Supreme Court rulings, the U.S. edges closer to the vanguard. That's good for America, and it's a very good thing for the world.

Follow us on Twitter @CNNOpinion.