On Monday Mitt Romney sang the praises of Pennsylvania’s Wawa convenience stores. The federal government should be as efficient as Wawa, he said, which allows you to order your hoagie through a touchscreen kiosk instead of talking to an employee.

Lots of people have been laughing about this. But we should instead look at it as one of the best defenses he’s offered of his work at Bain.

What Romney praised Wawa for doing is pretty Bain-esque: It found a way to replace low-skill workers with machines. And Wawa is a great example of why innovations like that are good for the public. Improved efficiency (including doing the same tasks with fewer workers) doesn’t just mean increased profits; it also means lower prices and/or higher quality for consumers.

But while improved efficiency is good for the consumer, not everybody is a winner -- and some parties have resorted to asking the government to stop Wawa from doing what it does. In the last decade, gas station operators in Maryland have complained that Wawa and Sheetz (a similar chain) were undercutting them on price.  Instead of cutting their own prices or finding ways to be more competitive, they got the state to enact a law setting a minimum statewide gas price, based on a fixed markup over wholesale prices. This forced Wawa to raise its prices. Wawa had also been giving out free coffee to people who bought gas. Maryland lawmakers helpfully made that practice illegal, too.

Wawa’s competitors complained that Wawa and Sheetz were selling gas as a loss leader for profitable convenience store products that its competitors don’t carry, such as hoagies you can order at a kiosk. It’s easy to see why other gas retailers would hate that. But it’s hard to see what the harm is to consumers.

Meanwhile, Wawa’s effect on low-wage workers is not what it appears at first glance. Wawa’s innovations reduce the number of employees needed to sell a sandwich. But they might increase sales so much that total employment at Wawa rises. Or it might mean that consumers take the money they save at Wawa and spend it elsewhere, creating jobs in other sectors. Even if we can identify specific jobs lost to automation, that doesn’t mean there was a net job loss.

But the broader point is that the purpose of firms isn’t to employ people. It's to make a profit, and firms make a profit by selling products and services for a price greater than it cost to produce them. To make products and services, of course, they have to employ workers. If firms incur unnecessary labor expenses, it leads to higher consumer prices.

Romney tends to defend his private equity record by pointing out all the people who now work at firms he was involved in creating, like Staples and Bright Horizons. What he should really emphasize is that Bain created enterprises that make things we want -- and that it shut down enterprises that were inefficient, so that economic resources could be better allocated to places where they created more value.

Those transitions are often painful, particularly for medium-skill workers whose job skills have ceased to be in demand. Romney should show empathy for those workers and explain what, if anything, the government should do to help them. But he should also fight back against the assumption that plant closures and layoffs are bad rather than an essential part of a dynamic economy.

(Josh Barro is lead writer for the Ticker. Follow him on Twitter.)