Last month—giving fresh ammunition to parents of messy-bedroomed teens everywhere—Karen Holloway, a resident of Lenior City, Tennessee, was sentenced to five days in jail for the crime of having an untidy front yard.

A judge rejected Holloway’s offer to perform five days’ worth of community service in lieu of jail time, though he later reduced her sentence to six hours.

“This opens a floodgate to everybody in Lenoir City being put in jail for silly things,” Holloway told local news station WVLT at the time. “[The bushes and trees] were overgrown, but that's certainly not a criminal offense."

All but the most fastidious of neatniks (and, I guess, the judge) would probably agree—but buried way, way deep down within the absurdity of Holloway’s brief incarceration may be a small nugget of insight into the human psyche. Past research, and plenty of religious traditions, have shown that people tend to equate physical cleanliness with moral cleanliness—and, by extension, to associate messy or dirty environments with bad behavior.

In the latest examination of the link between dirt and deviance, a forthcoming study in the journal Organizational Behavior and Human Decision Processes, marketing researchers from Rice University, Pennsylvania State University, and Arizona State University asked 600 people to participate in three different experiments designed to trigger disgust. One group was asked to view images of products like diapers, diarrhea medication, and cat litter; another wrote essays describing their most disgusting memories; and a third watched the infamously foul toilet scene from the movie Trainspotting (if you’re truly curious about Ewan McGregor’s adventures with “the worst toilet in Scotland,” view here at your own risk).

Once they’d been sufficiently grossed out, the volunteers answered questions testing their willingness to lie and cheat in exchange for money. Across the board, the researchers found, those who had just spent their time being disgusted had fewer qualms about unethical behavior than a separate control group, who had come to the questions without first being primed.

In a separate experiments, the researchers added another step in the middle: After the volunteers went through the same repulsion-inducing activities but before they answered questions about their own ethics, they viewed pictures of products like body wash and disinfectants. Exposure to products that promoted hygiene, the researchers found, acted as a kind of palate-cleanser to the volunteers, making them no more likely to say they would cheat their way towards reward than those in the control.

The connection between disgusting surroundings and bad behavior, the researchers hypothesized, may lie in disgust’s evolutionary role as a protector emotion, one that developed to keep us far away from the things that might harm us.

“When people feel disgusted, they tend to remove themselves from a situation,” lead author Vikas Mittal, a professor of marketing at Rice’s Jones Graduate School of Business, said in a statement. “The instinct is to protect oneself. People become focused on ‘self’ and they’re less likely to think about other people.”

The study findings, he added, could be applied to the workplace, with neat spaces cultivating more ethical, team-oriented employees: “If there is less likelihood to feel disgusted, there will be a lower likelihood that people need to be self-focused and there will be a higher likelihood for people to cooperate with each other.”

As the inhabitant of a pretty messy cubicle, though, I and the other slobs of the world can take refuge in the fact that other research has punched holes in the morality-cleanliness connection. Notably, a 2008 study in the journal Psychological Science found the opposite effect, observing that disgust actually made people more lenient, not less, when it came to ethical behavior.

Researchers asked one group of volunteers to unscramble sentences containing words linked to cleanliness, like “washed,” “immaculate,” and “pristine,” and another group to do the same with sentences made from only neutral words. Afterwards, participants were asked to rank different actions of dubious morality on a scale from zero (totally fine) to nine (absolutely wrong), including taking money from a lost wallet and eating a family pet to avoid starvation. And in a separate experiment within the same study, volunteers watched the same toilet clip from Trainspotting (the gold standard, it seems, in truly disgusting sights), with half of the viewers washing their hands before entering the room. In both cases, the people who had been primed to think of hygiene and purity—the hand-washers and the people who had unscrambled cleanliness-related sentences—were more lax in their judgments of what ought to be considered immoral.

Back in Lenoir City, Tennessee, Karen Holloway had a follow-up hearing scheduled for this month, and the judge for her case has apparently suggested he might send her back to jail if the city isn’t satisfied with her yard cleanup. After all, cleanliness is next to—well, actually, the jury’s still out on that one.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.