(Drew Angerer/GETTY IMAGES)

On Friday, Starbucks CEO Howard Schultz was applauded at the company’s annual investor meeting for doing something chief executives rarely do: He told off a shareholder.

Granted, the shareholder in question was Thomas Strobhar, the founder of the Corporate Morality Action Center, which states that its mission is to challenge corporations on issues like gay marriage, abortion and pornography. Last year Starbucks’ endorsed a Washington state bill to legalize same-sex marriage, which prompted the National Organization for Marriage to organize a boycott of the coffee behemoth. So in last week’s meeting, Strobhar criticized Starbuck’s endorsement for hurting sales and profits in the first quarter of 2012.

The complaint may have been typical of a corporate gadfly, but Schultz’s response was not. Rather than simply addressing the grievance, the coffee titan went further. He basically told Strobhar he could look to invest elsewhere if he wished: “If you feel, respectfully, that you can get a higher return than the 38 percent you got last year, it’s a free country. You can sell your shares of Starbucks and buy shares in another company. Thank you very much.” And in language one rarely hears from corporate executives, he said he was not putting concerns about any financial fallout first: “This was not an economic decision,” he told Strobhar.

Now of course, in reality, Schultz’s support of same-sex marriage is very much about dollars and cents — or at least about brand value and employee retention, which both affect the bottom line. For many big companies, the fear of losing out on talented employees or loyal customers who support gay rights is even greater than the fear of losing out on the dwindling number of those who don’t.

That’s especially the case for a company like Starbucks, with its coffeehouse roots, its urban customer base and its touchy-feely talk about employees (it calls them “partners” and offers benefits other fast-food restaurants do not). And Schultz is not alone in voicing his support for same-sex marriage; CEOs including Goldman Sachs’ Lloyd Blankfein, Amazon’s Jeff Bezos and Microsoft’s Steve Ballmer have as well.

The U.S. Supreme Court will hear arguments on two same-sex marriage cases this week. And at a time when the number of Americans supporting gay marriage is reaching historic highs, corporate executives realize that for every customer they lose for speaking out (“I’VE HAD MY LAST STARBUCKS” wrote one commenter on the news), there’s at least one — if not more — that they could gain (“Wow. I don’t care if this is just a PR move, my opinion of Starbucks just went way up,” wrote another).

Most shareholders realize this as well, it appears. Judging by the audience’s response to Schultz’s sparring with Strobhar (it was met with thunderous applause), it sounds like a majority of his investors agree with him.