Eight months into the pandemic, Brendan House, a nursing home in Kalispell, Mont., had not had a single resident test positive for the coronavirus. It was an extraordinary feat, given that 40 percent of the deaths from COVID-19 nationwide had occurred in long-term care facilities.

For years, Brendan House had received a top five-star rating from the Centers for Medicare and Medicaid Services, or CMS, the federal agency that oversees nursing homes, and its staff members took pride in looking after the 110 residents. Because the facility was connected to the local hospital, it hadn't faced the shortages in personal protective equipment or lack of testing and expertise that bedeviled other nursing homes during the pandemic. It seemed to be a model of how to survive a plague.

Then came November. The numbers of those testing positive in the surrounding community went up by a factor of 100 compared with in the summer. At Brendan House, one positive case "turned into 10, then 50. Before you know it, we had 54 people in our long-term area who were COVID-positive and only three residents who were not positive," a certified nursing assistant told me.

The facility was marked like a disaster zone: red rooms (for full isolation), yellow (recovered) and green (negative). The nursing assistant, who has been in the field for 15 years and asked me not to use her name for fear of harassment, described a cascading sense of doom. Sickness and death on an unmanageable scale.

She cried while recalling one resident, an older man who had been in fine health before he contracted the coronavirus and died. "He was in therapy, he was walking, he had a lot going for him," she said. "One of the things he told me when we went into quarantine was that he was going to pass away without seeing his son again."

I heard a similar account from a licensed practical nurse named Danielle in central Pennsylvania. (She asked that I use only her first name to prevent retaliation at work.) Her nursing home, too, had warded off the coronavirus until the fall. "Then October hit, and it was a mass disaster. It went from one to five to 10 to 15 patients," she said. "They had no idea how to isolate this."

A few weeks in, though it was too late to contain the spread, the home decided to put all COVID-19 patients on the same floor. They were moved into an unfamiliar setting, their belongings whittled down to a few pieces of clothing and mementos thrown in a plastic bag; a new set of masked nurses came in and out of their rooms. Only a handful of residents had cellphones, so Danielle used her own to help residents use FaceTime with family members and friends.

She somehow managed to avoid getting sick herself, but many co-workers contracted the virus and had to take time off, using up their vacation hours. Only in late October did the nursing home begin to offer a few extra dollars per hour in hazard pay.

Meanwhile, Danielle's duties were stretched to include the work of an undertaker, with instructions to treat the dead as though they were still contagious. "They make you sanitize the body and stuff any orifice full of cotton, spray them with disinfectant and put a mask on them and put them in a bag. To me, it hurts to do that. This was your family," she said.

The first coronavirus outbreak in the United States occurred in a nursing home near Seattle, in late February. Since then, the country has endlessly revised its hot spot map. Yet the situation in nursing homes and assisted-living facilities has only gotten worse: More than 120,000 workers and residents have died, and residents are now dying at three times the rate they did in July.

Long-term care continues to be understaffed, poorly regulated and vulnerable to predation by for-profit conglomerates and private-equity firms. The nursing aides who provide the bulk of bedside assistance still earn poverty wages, and lockdown policies have forced patients into dangerous solitude.

A few weeks ago, nursing home workers and residents began to receive vaccinations for the coronavirus, but even full immunization will not allay the tragedy that has unfolded in long-term care — not just the deaths, but also the isolation and neglect.

Lori Smetanka, the executive director of the National Consumer Voice for Quality Long-Term Care, an advocacy nonprofit, told me stories of nursing home residents who've gone weeks without being showered or having their teeth brushed. Residents with dementia have suffered terribly from a lack of human contact, leading to depression and loss of weight, mobility and speech.

Sharon Wallace, 62, whose multiple sclerosis landed her in a Rockland County, N.Y., nursing home several years ago, said that an unattended rash recently turned into an open wound, and she described feeling lonely and trapped in quarantine. "I feel like my health is going downhill," she told me.

When the pandemic is finally history, we'll need to deal with all of this: the staffing shortages, low pay and lack of accountability — the many ways we have failed residents, family members and staffers. The awful truth is that long-term care was designed to fail years before COVID-19.

Over the past few decades, the popularity of "aging in place," combined with new medical technologies and longer life spans, has changed the nature of care for seniors and people with disabilities. Residents of the nation's 15,400 CMS-certified nursing homes are much older, sicker and poorer than they used to be.

"Nursing homes are really little hospitals, yet they're not staffed like it. If you asked an ICU nurse to take care of 15 people, she'd laugh at you, but that's essentially what we have," Chris Laxton, the executive director of AMDA, the Society for Post-Acute and Long-Term Care Medicine, told me.

At the same time, many of these caregivers "are making $12 or $13 an hour," Alice Bonner, of the Institute for Healthcare Improvement, said. "They can barely support themselves and their families. Some of them are working in nursing homes during the day, then assisted living in the evening and home health at night."

As a result, workers probably helped spread the virus from facility to facility, home to home. And residents may have done the same. Depending on their condition, it's not uncommon for a senior or a person with disabilities to go from a nursing home to a hospital to assisted living within a few months' time.

Early on, when the coronavirus was killing mostly older adults, there was a sense of relief that the young might be spared. Nursing home residents were shut out from ordinary life; they were going to die anyway, commentators implied. And the workers who were getting sick — they weren't health professionals but glorified babysitters with minimum-wage qualifications. Weren't illness and death their lot?

A week after the outbreak near Seattle (and months after the first cases in China), CMS, run by Seema Verma, whose conflicts of interest outnumber her credentials, began to act. But some of the agency's decisions merely amplified existing problems.

Under President Donald Trump, CMS had already cut monetary fines for facilities with health and safety violations. Now it called off regular inspections in favor of a narrow, superficial infection-control survey. It also allowed for "temporary nursing assistants" with little training to fill in for certified aides.

When Congress allocated $5 billion under the CARES Act to help struggling long-term care facilities, a dozen companies accused of labor violations and Medicare fraud received more than $300 million in no-strings-attached relief. It wasn't until late summer that CMS mandated testing for residents and workers.

Nursing home operators have long complained that Medicaid doesn't pay them enough to provide adequate care, but the business is not, apparently, a bad one to be in. Two-thirds of nursing homes are for-profits, and the sector has been swallowed up by corporate chains and investment firms whose involvement correlates to lower staffing and worse care.

Now the industry is pleading poverty while paying lobbyists to seek protection from lawsuits. In more than half the states, long-term care providers are shielded from liability for COVID-19 claims brought by residents, workers or their families, and legislation that would extend such immunity nationwide is pending.

Proponents of the protections, like Mark Parkinson, a former governor of Kansas and the president of the American Health Care Association, which represents 14,000 nursing home and other long-term care entities, argue that "most of these facilities will end up going bankrupt" without them.

But if now is not the time, when, and under what conditions, should nursing homes and assisted-living facilities be held accountable for the welfare of their residents and workers?

Elizabeth Halifax, a registered nurse and expert in elder care at the University of California, San Francisco, pointed out that "nursing homes have had big increases in funding during COVID, but no real improvements in staffing have resulted." The core issue, she said, is that "there are no limits on the levels of funding that nursing homes allocate to administration and profits."

Ask anyone in long-term care why the pandemic has been so damaging, and "staffing" will be the reply. Sufficient numbers of well-trained nurses and aides have always been the key to managing disease, and during the pandemic, homes with higher staff-to-resident ratios have had fewer positive coronavirus cases and casualties. Such facilities are, however, rare.

It's hard to hire for a job that involves helping others bathe and eat, dressing wounds, and cleaning and providing emotional support — for low wages, little paid time off, a short career ladder and unpredictable part-time hours. Factor in the risk of getting sick and dying, and retention, let alone recruitment, becomes far more difficult. In 2020, direct caregiving may have been the most dangerous job in America.

It's telling that many nursing homes have chosen to hire temporary subcontractors (who are actually paid at higher rates) rather than increase wages and benefits for permanent employees. Hank Drummond, the chief clinical officer of Cross Country Healthcare, a national staffing agency, told me, "The demand, compared to what it usually was, is four to five times more." Jane Davis, the administrator of Landmark Care and Rehabilitation in Yakima, Wash, said that she resorted to hiring agency workers after a dozen employees quit out of fear of developing COVID-19.

President-elect Joe Biden is about the age of the average nursing home resident. Over the summer, he announced a $775 billion proposal to provide care for children, seniors and people with disabilities. The plan, though notional at this point, would eliminate the 800,000-person waiting list for long-term care under Medicaid and pay for 150,000 new community health workers for seniors. It could also help transform millions of low-wage, high-turnover, often transient gigs into stable careers.

But to prevent another disaster on the scale of the coronavirus, the Biden-Harris administration (and state and local regulatory bodies) should go further.

CMS must ensure that the $264 billion paid by Medicaid and Medicare to long-term-care providers actually goes to caregiving, instead of shiny new buildings or executive pay. It can do so by placing caps on how much money is earmarked for profits and bureaucracy, imposing strict accounting requirements and conducting regular audits. Even Parkinson, the AHCA president, acknowledged that any increase in Medicaid funding should come with "some accountability to make sure it goes to patients."

CMS should also regulate assisted-living facilities that serve Medicaid and Medicare patients, just as it does nursing homes. (At present, these facilities are overseen by state agencies, with wide variation.)

Then private-equity firms might have less incentive to enter this field, and patients and workers would know, once and for all, whether businesses are telling the truth when they say they're operating on "a razor-thin margin."

To improve residents' quality of life, the government should mandate that long-term-care facilities have appropriate staffing. We can do this by requiring a minimum amount of nursing time for every resident — 4.1 hours per day, experts say. A bill to this effect was introduced in Congress in 2019.

And certified nursing assistants must be paid a living wage — in most places, $20 or more per hour. A recent study found that such an increase would finance itself by elevating the standard of care. With stable, better-paying jobs, nursing-home staff members could also avoid working in multiple facilities, helping reduce the transmission of the coronavirus and other, future viruses.

In addition, Biden must reverse Trump's laissez-faire approach to this sector. Both CMS and the Occupational Safety and Health Administration should be given the resources they need to inspect, investigate and fine providers for health and workplace violations. The incoming administration must also strengthen workers' rights to organize and protest unsafe conditions under the National Labor Relations Act, as it has already promised to do.

Most important, we must transform the way we think about long-term care — treating it not as human warehousing or the duty of underpaid women, but as an integral part of our medical system.

All of these changes are possible — and modest, really, given the magnitude of the emergency. By 2050, 19 million people will be 85 or older, and many will require help to live with comfort and a modicum of dignity. What we really need, for all Americans, is single-payer health insurance that covers quality long-term care. But short of that, Biden and Kamala Harris have a chance to make amends for the deadly failures of the current administration.

Just before Christmas, I checked in with Danielle, the licensed practical nurse in Pennsylvania. She had a rare day off, which meant a reprieve from her oppressive uniform of N95 respirator, goggles, face shield, gown and shoe coverings. "Everybody in the facility has it," she said. And now patients who had been treated for the virus in the hospital were being discharged straight into her nursing home to quarantine.

"The stress is ungodly," she told me. "Every day you go there, your family pays for it when you get home."

"The reason I keep going back is, I like long-term care. I've always liked my people, and they love seeing me. They know when they have me as their nurse, they're going to get the right food and medication, and can get a snack or make a phone call."

Yet Danielle, like many workers I interviewed, has thought about quitting. "There are jobs that offer $45 per hour to do COVID testing," she said. As if to nudge her out the door, her nursing home was recently purchased by a large corporation, nullifying the union contract, and management reneged on the promise of holiday bonuses.

The facility hadn't yet received its shipment of vaccines, but Danielle, who called herself a "usually pro-vaccine person," told me that she and most of her co-workers weren't planning to get the shot. Scientists agree that the vaccines are safe and well worth the risk, but it's easy to understand Danielle's mistrust. After all the death she's witnessed, she doesn't believe that pharmaceutical companies or the government or her bosses have suddenly come to value caregivers' lives.

E. Tammy Kim is a contributing opinion writer for the New York Times, and a co-author and co-editor of Punk Ethnography, a book about the politics of contemporary world music. Her work has appeared in the New York Times Magazine, the New York Review of Books, the Nation, the New Yorker and many other outlets.