Plastic-bag bans are currently on the books in about a dozen U.S. cities—a dozen cities that will be seeing fewer bags clustered in rivers, tangled in tree branches, and clogging storm drains. Those cities might also start noticing an uptick in junk-food purchases.

That’s the implication of a study that tried to figure out whether people’s shopping habits changed when they brought their own grocery bags. For the study, Uma Karmarkar, a professor of marketing at Harvard Business School, and Bryan Bollinger, a professor of marketing at Duke’s Fuqua School of Business, analyzed loyalty-card data from some 140,000 trips to a single grocery store in California in the mid-2000s. They found that people are 13 percent more likely to buy organic products when they bring their own bags—and they’re also 7 percent more likely to buy junk food, such as chips and cookies.

To explain these changes, the researchers propose two theories, one for the boost in organic purchases and one for the boost in what they call indulgent purchases—chips and cookies. The first explanation is the simpler of the two: People who walk into a grocery store with canvas bags in hand are already in a greener mindset, and this affects their purchasing decisions. Although many people don’t even know precisely what “organic” means, they still perceive buying organic as doing a favor for the environment, so it makes sense that their environmentally-friendly mentality might lead them to be more open to purchasing organic foods.

The theory as to why bringing a bag makes people more likely to buy junk food is more interesting. Karmarkar and Bollinger chalk it up to what’s called the “licensing effect,” which describes the phenomenon that after people make a decision they consider responsible and noble, they feel justified in giving themselves a reward down the line. This sort of moral accounting may sound a little dubious, but it’s not unheard of: In one 2009 study, subjects who bought environmentally friendly products were more likely to later cheat at a simple counting game than those who bought things that weren’t explicitly labeled green.

It wasn’t just that the type of person who brings a bag—the Whole Foods crowd, really—also happens to be the type of person who cares about buying organic foods. Karmarkar and Bollinger were able to break down the data to show that individual shoppers behaved differently when they brought reusable bags versus when they didn’t. There’s something about bringing a bag that actually changed people’s habits.

One group of people proved impervious to the effects of bringing grocery bags: parents. It’s not entirely clear why this is the case. It might be because, as they shop, parents are thinking about what they need to feed their kids, not their own indulgence. It could also be that they’re less likely to view bag-bringing as a virtuous act, instead filing it under the category of parental duty. (The researchers were able to sort out the parents from the non-parents by seeing which loyalty cards were linked to purchases of diapers or baby food, but a later survey they administered suggests that the bag effect was dampened for all parents, not just those of young children.)

It’s funny, though, that these environmental and moral ledgers seem to have remarkably short, context-dependent shelf-lives. Bring a bag, enter the store, buy some Oreos as a pat on the back, exit the store—ledger balanced. But the human brain has a harder time tallying the consequences of actions outside of the bookends of a single grocery trip. Take the manufacturing of reusable bags as an example: It’s been estimated that those colorful polypropylene ones need to be used about 10 times to ensure that their production did less to damage the environment than a one-time-use plastic bag. For a standard canvas tote, the balance tips at about 130 uses.

And that’s just the bags. Once people get home, things get much worse: A typical U.S. household discards roughly $1,500 worth of groceries every year. Worldwide, wasted food emits the equivalent of 3.5 billion metric tons of carbon dioxide, and, as my colleague Eleanor Smith has noted, “If food waste were a country, it’d be the third-largest greenhouse-gas emitter on the planet, after China and the U.S.” Maybe reusable-bag users don’t deserve those Oreos after all.