James Martin/CNET

San Francisco -- and the tech industry -- are beaming with Pride this weekend.

The United States Supreme Court on Friday ruled same-sex marriage a constitutional right, one day before San Francisco begins its famous Pride festivities, one of the largest celebrations of lesbian, gay, bisexual and transgender -- aka LGBT -- culture in the country.

The tech industry is practically euphoric, especially after high-profile executives this year, from Apple CEO Tim Cook to Salesforce.com CEO Marc Benioff, publicly advocated advancing gay rights.

But that advancement works both ways, said Gary Virginia, board president of SF Pride, which organizes the celebration. Speaking out is not just a personal decision for tech execs; it makes good business sense too, he said.

"They attract a younger population for their workforce, and it's been proven that social attitudes are changing," said Virginia. "So it behooves them to have progressive policies to attract LGBT employees. I think they see the benefit of it."

The celebration caps off a landmark year for the gay rights movement. In September, Apple 's Cook wrote an essay saying he's gay, making him the first openly gay CEO of a Fortune 500 company. A month later, he allowed for his name to be attached to an LGBT antidiscrimination bill in his home state of Alabama.

James Martin/CNET

In March, Benioff said he had canceled all Salesforce events in Indiana after its governor signed a law that would allow businesses to refuse service to anyone in the LGBT community on religious grounds. Less than a week later, dozens of executives from Airbnb, Ebay, Jawbone, Lyft, PayPal, Twitter and other companies signed a joint statement in The Washington Post against the religious freedom laws either passed or being considered in several states.

The tech industry is a relatively recent ally. LGBT leaders point out it's taken decades to achieve Friday's Supreme Court decision. New York City, for example, is commemorating the anniversary of the 1969 riots at the Stonewall Inn, which many consider the jump start of the movement. The 1978 assassination of Harvey Milk, an openly gay San Francisco board supervisor, galvanized the national LGBT community.

Pride Parade

Tech giants including Apple, Facebook and Google have been mainstays of San Francisco's giant Pride Parade for years. But the year of activism from the tech industry leading up to this year's parade has been a standout, particularly fueled by Cook's public support of the issues, said Kellie McElhaney, director of the University of California, Berkeley's Center for Corporate Responsibility.

"When you have him stepping up, that's huge," she said, referring to his role as the leader of the most valuable company in the world. "It's different from anything we've seen in the past."

Justin Sullivan/Getty Images

But that doesn't mean the relationship between the tech industry and the LGBT community hasn't had its share of friction. Members of the drag and transgender community last year protested against Facebook's policy requiring all members to use their real names. Some people petitioned the parade to ban Facebook from marching in it this year. The SF Pride board, however, voted to let the company march.

"That's just really not how Pride operates," said Virginia, responding to criticism for not banning the company.

"Facebook flat out said, 'We know it's an imperfect system,'" he said, adding the social network will hold four meetings with the LGBT community in the coming year to devise a solution.

"Facebook has been a staunch supporter of the LGBT movement for numerous years," Virginia said. Virgina points to Facebook joining Google, Amazon, Microsoft and Twitter in a 2013 friend of the court brief filed with the Supreme Court protesting the Defense of Marriage Act, which attacked same-sex marriage.

The social network is proud of marching in the parade, as well as its commitment to LGBT rights "as a company and employer," Facebook said in a statement.

And Virginia said he's happy to have those companies on board.

"The tech industry was on the right side of history for equality."