Morality is easy when it costs nothing. That is a good principle to keep in mind as nearly two dozen companies bathe in the glow of public approval after noisily abandoning their ties to the National Rifle Association this week. Delta, Dick's Sporting Goods, Hertz Rent a Car, Avis, Budget, LifeLock, MetLife — these and a batch of other corporations renounced their ties to the NRA. On Facebook and Twitter, grateful activists are encouraging people to support the companies with dollars to reward their brave stances: rent cars, buy airplane tickets, take out insurance policies. The mayor of Portland, Oregon, praised Dick's and urged other companies to follow suit. "Support retailers that do the right thing," cheered one influential political consultant.

Given the love, it seems like a no-brainer to ditch the NRA: This is the kind of reputation boost and customer goodwill that you can't pay for. In fact, companies know these accolades are all too easy to buy — and they're pretty cheap, too.

None of these companies took a particularly controversial stance. School shootings have been a growing problem since Columbine in 1999. In the ensuing 19 years, none of those companies cut ties with the NRA, pulled back discounts or declared their independence from gun manufacturers. And for 19 years, they didn't have to.

So what changed? The Parkland, Florida, shootings made pressuring the NRA a mainstream opinion, and there is nothing better for a company's bottom line than supporting a mainstream view. An eloquent, quick-witted group of young survivors created a different kind of political and moral electricity. Apathy was no longer an option. In only two weeks, regulation of assault weapons — thwarted and danced around by lawmakers for years — became an urgent and mainstream opinion.

It's smart, but not especially brave, to see on which side your bread is buttered. It's the easiest thing in the world to find your moral center when a pivot to ethical behavior results in widespread approval. That is why what has happened this week was not a vast moral stand by America's corporate sector. It was a simple calculus of profit and loss.

It costs these companies almost nothing to give up their discounts to the relatively paltry membership of the NRA. It would cost them a lot to lose every other customer. As influential activists, celebrities and influencers declared boycotts and whipped up public sentiment against any NRA-friendly companies, executives faced the possibility of reputational and financial harm. (No one wants to face the same disaster that Coca-Cola did in the 1980s, when activists urged a national boycott of the company for doing business in South Africa, which was then under apartheid.) And all they had to do to avoid it was give up a bunch of discounts to a relatively small subset of potential customers. (The NRA claims 5 million members, which sounds considerable until you realize that AARP has 37.8 million.)

Dick's Sporting Goods has won considerable praise: Not only did it promise to stop selling assault weapons, but the company also jumped into political advocacy with a slate of gun-control measures it urged lawmakers to adopt. (Parkland shooter Nikolas Cruz reportedly bought a gun at Dick's, though not the infamous AR-15 that he used in the rampage.) Now Dick's just has to keep its resolve, because it didn't before. The chain previously promised to stop selling assault weapons after the Sandy Hook shootings, but it went back on its word within eight months, when it decided to sell $800 AR-15s at its Field and Stream stores. Dick's chairman and CEO Ed Stack had to clarify this week that the new move to stop selling assault weapons was meant "permanently," to distinguish it, perhaps, from the temporary precedent.

And still, for all the advocacy, optics around a company's reputation cannot be separated from these decisions. Dick's made its announcement in part because, as Stack said, "we don't want to be part of this story any longer."

It bears reminding that giving up these sales is unlikely to be a financial sacrifice for these companies. Gun sales are falling, according to a widely used industry proxy: FBI background checks, which were down more than 8 percent in 2017. Dick's maintains 644 stores in 47 states, but only 19 Field and Stream stores in nine states. And the company was well aware that the "improper or illegal use by our customers" of guns or ammunition sold by Dick's "could have a negative impact on our reputation and business," as it acknowledged in its 2016 annual report. Walmart stopped selling assault weapons in 2015 — not out of principle, but because customers weren't buying them. Brian Rafn, director of research at Morgan Dempsey Capital Management, told CNN Money that so many stores sell military-style assault weapons that "a few guns here or there at Dick's isn't going to make a difference" to the consumer market.

There are some companies for which guns and the NRA are a pretty solid revenue stream. Predictably enough, they're not breaking off ties with the gun lobby. FedEx, the most famous of the holdouts, has a policy of making gun-shipping accommodations for 86 firearms manufacturers and the NRA, according to a company document obtained by ThinkProgress. That is revenue that FedEd doesn't want to give up, especially to a competitor. There's profit at stake, so it's not making any brave stands.

FedEx will have to face public disapproval and reputational risk to keep that profit: Celebrities such as Alyssa Milano, social media influencers and activists are calling for a one-day boycott on March 1 at the remaining large companies that still have business dealings with the NRA — FedEx, Amazon and Apple, in this case. Of course, there are plenty of people who don't particularly care what Milano does and strongly oppose gun control — but opponents are a growing minority. Support for gun control has surged to its highest point in 25 years, and the NRA is viewed increasingly unfavorably.

All of this pressure was, of course, the purpose of the threats of boycotts: to turn the free market into the regulatory body it was promised to be. To force the companies to recognize a higher financial power than the NRA — consumers — and to bring them to heel before the power of consumer dollars. In return, the companies that obliged and broke off their NRA ties would not only get to keep most of their business, but perhaps gain even more. This arrangement is entirely sensible, but it is not a transformative moral reckoning worthy of emotional outpourings of support for corporate bravery. The companies understand it is a transaction — and consumers should understand that, too.