On Wednesday, Gap Inc. announced that it would be setting a minimum wage for what it pays its employees, raising the rate to $9 for the remainder of 2014 and $10 in 2015, a move that the company says will benefit 65,000 of its employees.

The decision generated yards of good press, with even President Obama hailing the news. “In my State of the Union address, I asked more businesses to do what they can to raise their employees’ wages,” Obama said in a statement. “I applaud Gap Inc. for announcing that they intend to raise wages for their employees beginning this year.”

But just as CVS's decision to stub out smokes from its stores two weeks ago was more than pure altruism, Gap's move will do more that just give employees a raise.

Call it the sacrifice strategy: Whatever it may cost the retailer in the short term, it's also a smart decision to improve customer service and recruit and retain the best employees (in Gap's case) or improve its relationship with health care providers (in CVS's). And because it could hit these companies where it hurts — their bottom line, at least in the short-term — the message is bound to be more credible with customers, who increasingly choose to spend their money with companies that actively share their values.

Both companies are expected to take some immediate financial hit by their decisions. CVS said it would lose $2 billion in sales on an annual basis from the average tobacco shopper, losses it said would eventually be offset by other opportunities. Gap, meanwhile, is not "publicly quantifying the financial impact of this decision," the company said in an online FAQ about the decision. But the move is likely to generate some kind of short-term cost, even a modest one — though happier employees may ultimately bring in more sales.

Both companies are also getting ahead of issues that were already changing on the local level, and that someday may not be so voluntary. Who knows if states will ever prohibit the sale of cigarettes, but San Francisco and some municipalities in Massachusetts have already banned sales of tobacco in stores with pharmacies.

Likewise, no one knows when a $10 federal minimum wage, as President Obama is supporting, might actually happen. But some states and cities have already raised theirs, including (again) San Francisco, where Gap is based, which has a $10.74 minimum wage. California has set its minimum wage at $10 an hour beginning in 2016.

In addition, both companies also have strategic long-term reasons they're making the move. For CVS — which is as much a health-care company as it is a retail pharmacy — stopping the sale of tobacco should help better align the company with its health insurer and provider partners.

At Gap, which must compete with strictly online retailers, its in-store workforce increasingly could serve as its differentiating factor and, if used well, a competitive advantage. The company's "reserve-in-store" program, Gap CEO Glenn Murphy told the New York Times, requires a more skilled workforce that can help make sales to customers once they arrive at the store to pick up items they reserved online.

Finally, both companies are inserting themselves into ongoing national conversations about policy issues, even if the topic isn't actually political for them. Being the first out of the gate allows them to become part of that discussion, whether it's health care or the minimum wage, and get plenty of positive press in the process.

Gap may benefit from this in particular, as research shows that customers are especially attuned to how businesses treat their employees. A 2012 paper from public relations firm Weber Shandwick reported that the way companies treat employees is the third-most popular issue discussed by consumers when they talk about brands. Yet companies rarely make it a priority to communicate those values to their consumers.

As a result, talking about their own wage minimums is likely to bring in more conscientious shoppers — those who like buying from Costco because of what the warehouse club pays its employees, or feel good about buying Patagonia jackets because of their sustainable materials. And whether you call it policy P.R. or a strategy that means short-term sacrifice, it's also something else: smart business.

Jena McGregor is a columnist for On Leadership.

Read also:

CVS's smart no-smoking strategy

Why Obama hearts Costco

Like On Leadership? Follow us on Facebook and Twitter.