We can’t all be Wesley Autrey—and most of us wouldn’t even try. Autrey is the man who became celebrated in 2007 as the “Subway Samaritan” after he was standing on a New York subway platform and a man next to him had a seizure and fell onto the tracks. Autrey leapt down and lay atop the stranger in a trench between the rails, allowing the oncoming train to pass safely over both of them.

“I don’t feel like I did something spectacular,” Autrey told The New York Times. “I just saw someone who needed help.”

In the era of coronavirus, there are a lot of Autreys out there: the doctors and other caregivers plunging unbidden into infection zones to diagnose and tend the sick, aware that they are exposing themselves to the virus. Then there are others, who are being asked to sacrifice less—and the results have been inconsistent. Tongues clucked and fingers wagged when word got out that a Missouri father had broken a required coronavirus quarantine and attended a father-daughter school dance after the man’s other daughter tested positive for the coronavirus. The school was closed the following Monday for a hospital-grade cleaning.

A coronavirus quarantine is not easy. It amounts to two weeks of house arrest for a disease you may not have. Your fortnight of confinement is done entirely in the service of others, protecting them from possible infection. A situation like that causes two of our more primal and conflicting impulses, selfishness and altruism, to bump up hard against each other.

“I think these quarantine issues are going to put many people in a moral conundrum,” says Jonathan Haidt, Professor of Ethical Leadership at New York University’s Stern School of Business.

Haidt can speak with particular authority. When he talked with TIME, he was in the sixth day of his own 14-day quarantine (so-far symptom-free), having been exposed to the coronavirus by an infected individual during a talk he gave about his new book, The Coddling of the American Mind. He plans to honor every day of his viral sentence. But why?

For one thing, Haidt, like all of us, wants to be thought well of—by himself and by others. “As someone who studies moral psychology, I can say we all do care about the welfare of other people—although inconsistently,” he says. “We also all care about our reputations—very consistently. I would truly feel guilty if I passed the virus onto anybody else. I would feel great shame that people knew that it was me who broke the quarantine.”

“Shame is huge,” agrees Steven Pinker, professor of psychology at Harvard University and author, most recently, of Enlightenment Now. “We carry around in our heads the expectation that anything we do might leak out. It’s that public opprobrium for misbehavior that keeps us in line.”

But shame can be overcome, and if you’re secretive about things, no one even has to know you misbehaved. Yes, you’re under quarantine but you’re not under surveillance. If you slip out for dinner or to shop for a few things, who’s going to spot you? Acting altruistically takes some moral muscle.

Haidt identifies three sets of circumstances that tend to drive people and nations toward either selfish or altruistic behavior. The first is some kind of danger from outside—an attack by a common enemy. “That makes people band together,” he says. “Pearl Harbor was the perfect way of doing that and September 11 was a good example too.”

Consider the lines at enlistment centers the morning after Pearl Harbor and the rationing people tolerated during the long span of a four-year war. Consider the similar lines that spontaneously formed at blood donor centers in New York City on 9/11, before it was clear that there would be few survivors to receive the donations. “There is altruism for the public good, and it does pay dividends,” says Pinker. Any time we step forward to give without expectation of reward, there is a corresponding party who benefits without a requirement to pay. But for the giver, the dividends can include an element of selfishness even when they look selfless. “If you do something that’s civic-minded your reputation goes up.”

Keep up to date with our daily coronavirus newsletter by clicking here.

Things get a little more complicated when the attack comes not from a human enemy, but from a virus or other pathogen. In this case, moral stress-cracks form in the community because other people are the source of menace. “Diseases do not bring us together,” Haidt says. “They can push us apart because of the nature of contagion.”

Worse than pushing us apart, they can bring out the sublimely ugly. Think of the shaming and shunning of lepers, of the homophobic hatred that was given full voice—and even imagined moral license—during the early years of the AIDS epidemic.

Third on the list of social stressors is any kind of deprivation—especially in the case of famine or shortage of other basics. “Scarcity and starvation activate the mindset of hoarding and deception and dishonesty,” Haidt says. “So when masks are in short supply many people feel a need to get some.”

It’s not just masks: whether in the face of a creeping pandemic or an approaching blizzard, store shelves are quickly stripped of bottled water, canned foods, flashlights, batteries, and ever and always toilet paper, far more than the circumstances call for in most cases. Since all such resources are finite, the marginal sense of greater security the hoarder achieves by buying out, say, the band-aid shelf leaves the next shopper with nothing at all.

The novel coronavirus, of course, ticks both the contagion and scarcity boxes, which is one reason people are behaving badly. And when they do behave badly—like breaking quarantine—there’s a social reason too for the tongue-clucking and finger-wagging that follow. “There is a certain amount of social glory that comes from being the punisher,” says Pinker.

That, of course, is not always fair—much as it might seem to be warranted. Haidt is honoring his quarantine, but he is cognizant that he has it comparatively easy, with a job that allows him to telecommute.

“I don’t think I’m a good example because for me the cost is minimal,” he says. “I think a lot about single parents who have a job and no alternative arrangements. This is going to be hard for them.”

The U.S. government is rising—slowly—to the need, debating offering paid leave and other forms of job security for people working paycheck to paycheck at jobs that require their physical presence. A system that doesn’t force people to choose between honoring a quarantine and feeding their families will make it easier for more people to make the moral choice.

“I did what I thought was right,” is how Autrey put it back in 2007. When the coronavirus epidemic at last passes into history, it will be to the credit of both individuals and policymakers if we can echo his words.

Please send any tips, leads, and stories to virus@time.com.

The Coronavirus Brief. Everything you need to know about the global spread of COVID-19 Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Jeffrey Kluger at jeffrey.kluger@time.com.