FORTUNE –The nation’s highest court on Wednesday struck down part of the Defense of Marriage Act (DOMA), which barred the government from recognizing same-sex unions in federal law. While gay rights advocates rejoiced at the decision, it’s also a win for some of America’s biggest corporations struggling to keep talented employees with foreign-born same-sex spouses.  For Americans and legal immigrants in traditional marriages, obtaining a green card for a foreign spouse is relatively easy.  Traditionally, American citizens have been able to sponsor their foreign-born spouses for residency visas, known as green cards. But under DOMA, lesbian, gay, bisexual and transgender Americans did not have the same right. And as a result, U.S. businesses have watched as some of their most talented employees leave to live with their foreign-born partners abroad.  In March, 28 U.S. companies signed off on a letter urging Congress to recognize same-sex unions for immigration purposes. Texas Instruments TXN , US Airways LCC , Marriott International MAR , and others said making it possible for foreign-born spouses to live and work in the U.S. makes business sense. Companies go through the expense of relocating gay and lesbian employees, only to lose them because of their spouse’s visa problems. “We cannot afford to lose our most precious resource: talent,” the letter stated.  MORE: Big Law has a shrinkage problem  The barriers have also hindered companies from taking on new workers. According to a recent survey by the American Council on International Personnel, an association of employers that advocates immigration reform, 42% of member organizations said they have missed out on hiring opportunities because U.S. immigration law precluded the prospective employee from bringing his or her same-sex partner into the country.  Many binational same-sex couples chose to live abroad rather than in America. Martha McDevitt-Pugh, for instance, spent many years working at Silicon Valley-based Informix Software, where she ran the database software firm’s education and publications arm. Managing a department of 80 people, she was a key player in overseeing the company’s reorganization ahead of its later split and acquisition by IBM. But when it was time to choose between her career and her same-sex partner, an Australian-born woman living in the Netherlands, she reluctantly decided to leave her job and take her talents overseas.  Some same-sex couples have found ways to live together in the United States. When former U.S. Representative Jim Kolbe (R-Ariz.) could not sponsor his Panamanian partner, Hector Alfonso, for an American visa, Alfonso successfully applied under the EB-5 investor visa program. This program grants visas to individuals who make a substantial capital investment (over $500,000) in America that creates or preserves at least 10 jobs. Kolbe acknowledged in an interview that he and Alfonso had to dig into their retirement savings to pursue this option, and that it would not be economically feasible for most couples.  Before Wednesday’s ruling, Democratic Sen. Patrick Leahy of Vermont pushed an amendment to the immigration bill that would have removed such hurdles for binational same-sex couples seeking to live in America. The Leahy Amendment would have effectively recognized same-sex unions in the context of immigration law, but it faced massive bipartisan opposition, including some from Democrats who supported it in principle but feared that it would kill the immigration deal.  MORE: Did Congress miss the moment on serious plans for U.S. workers?  Leahy had offered his amendment again. But with the court’s decision, the issue is moot. The ruling will allow LGBT Americans to sponsor their legally married partners for visas under the expedited track federal immigration law provides for spouses of U.S. citizens.  Nonetheless, Corporate America’s support of the principles of the Leahy Amendment highlights a massive shift in public opinion as more and more Americans support legal equality for gays and lesbians. “What’s notable … is that global companies are leaders” on this issue, said Rachel Tiven, Executive Director of Immigration Equality, an LGBT rights advocacy group. “They are way out front in saying that what they care about is, are you good at your job?”  McDevitt-Pugh, at least, is eager to return to the United States. She misses the “entrepreneurial opportunities” available in America, she said in an email. “Opening up immigration to LGBT families [will] stop the brain drain of talented Americans.”
Corporate America can now offer foreign-born same sex spouses the same rights heterosexual immigrant spouses have always received: The opportunity to stay in the U.S.