An exodus of top-level officials during the previous administration has left the Department of Housing and Urban Development short of expertise even as its role expands.WASHINGTON — During the 2020 campaign, President Biden pledged to transform the Department of Housing and Urban Development into a frontline weapon in the fight against racial and economic inequality.But when his transition team took over last fall, it found a department in crisis.The agency’s community planning and development division, the unit responsible for a wide array of federal disaster relief and homelessness programs, had been so weakened by an exodus of career officials that it was faltering under the responsibility of managing tens of billions of dollars in pandemic aid, according to members of the team.And it was not just the planning unit. In some divisions, as many as 25 to 30 percent of jobs were unfilled or occupied by interim employees. The losses were concentrated among the ranks of highest-skilled managers and policy experts, many of whom had been overruled, sidelined, exiled and eventually driven away under President Donald J. Trump and his appointees.Roughly 10 percent of the agency’s work force left during Mr. Trump’s first years in office, according to agency estimates. But that came on top of a decade-long decline resulting from attrition, poor recruitment and budget deals cut by the Obama administration with a Republican-led Congress at the time that prevented the agency from replacing departing employees.As a result, the agency’s total head count fell by 20 percent, to 6,837 from 8,576, from 2012 to 2019.Other cabinet departments, like the Education Department and Environmental Protection Agency, face similar problems. But the staffing shortfall at the housing department is a case study in the personnel issues generated in part by Mr. Trump’s conflicts with experienced career government employees who carry out programs and policies. And it is especially worrisome to Biden administration officials because it threatens to undermine their hope of transforming the agency into a central player in the president’s efforts to put more focus on social justice issues.“I’m not going to sugarcoat it,” Marcia L. Fudge, Mr. Biden’s new housing secretary, told a Senate committee last week during budget hearings. “Until we can start to build up our staff, and build up our capacity, we are at risk of not doing the things we should do.”Ms. Fudge, a former congresswoman from the Cleveland area, was there to urge lawmakers to adopt the agency’s 2021 budget request, which includes money to hire hundreds of managers and skilled technical support staff.The problem comes as the department’s responsibilities are growing along with the scale of the programs it manages.The administration’s relief package, passed in March, included $21.55 billion for emergency rental assistance, $5 billion in emergency housing vouchers, $5 billion for homelessness assistance and $850 million for tribal and rural housing, on top of a similar amount allocated under the Trump administration.Some of the funding is routed through the Treasury Department. Even so, it amounts to the greatest increase in housing and related programs in decades. Mr. Biden’s infrastructure bill, now the subject of intense negotiations on Capitol Hill, would provide $213 billion more.A Maricopa County constable preparing eviction orders last year in Phoenix. The Biden administration’s coronavirus relief package included funding for emergency rental assistance and homelessness assistance, among others.John Moore/Getty ImagesThe department has long sought to shake off the legacy of scandals. And under Mr. Trump’s housing secretary, Ben Carson, morale plunged, prompting a wave of resignations and retirements of top-tier civil servants who had managed to hold on during other crises, current and former officials said.One former career official, who departed in early 2020 for a job at a less embattled federal agency, estimated that two-thirds of the most experienced employees he interacted with day to day had left over the previous three years.“It’s more than just the number of valuable staff they have lost, it’s all that expertise that was driven out,” said Lisa Rice, the president of the National Fair Housing Alliance, a group in Washington that has pressured the department to bring more antidiscrimination cases.“It will set back the department for years,” she said. “HUD just doesn’t have the in-house legacy knowledge they used to have.”Mr. Biden’s transition team, made up of Obama-era veterans, deployed several of their most experienced members into interim leadership roles to plug the gap at the planning unit. Ms. Fudge, in turn, has installed experienced officials in other hard-hit divisions, although it has been slow going, as evidenced by the dozens of vacancies still visible on its online organizational chart.The losses are seriously affecting the response to the pandemic, Ms. Fudge told the Senate hearing. They are hindering distribution of emergency aid to low-income tenants and leaving many localities without guidance from experienced HUD employees on how to run new programs funded by the flood of coronavirus assistance cash, she said.In November, the department’s inspector general identified numerous “leadership gaps” at the headquarters, concluding that “employees often do not have the right skill sets, tools or capacity to perform the range of functions” needed to do their jobs.Many of the problems the watchdog identified were chronic, such as an ineffective human resources department. But about two dozen current and former department officials interviewed for this article blamed the chaos and disruption on Mr. Carson, who once admitted the job was more complicated than his previous gig — brain surgery.Mr. Carson, an unsuccessful 2016 Republican presidential candidate, took little interest in the day-to-day operations of the department, and was often informed of key hires by White House officials after the fact, according to people who worked with him. He often ceded control to political appointees, some embedded inside his department, others working from the White House, who pursued their own agendas.Under Ben Carson, the Trump administration’s housing secretary, morale plunged, prompting a wave of resignations and retirements of top-tier civil servants.Lexey Swall for The New York Times“People like to make Carson a scapegoat,” said Armstrong Williams, his spokesman and political adviser. “People moved on from HUD for all kinds of reasons. Blaming him is a cop-out.”Nonetheless, three of the agency’s divisions were especially crippled under his watch. One was the unit responsible for overseeing disbursement of federal block grants to states hit by hurricanes and other natural disasters. Another was the homeless assistance operation. The third was the fair housing division, whose job is to enforce federal laws prohibiting discrimination based on race, gender, ethnicity and disability.This was the unit Mr. Trump singled out for attack in the 2020 campaign, stoking white grievance by claiming that an initiative to review discriminatory local zoning restrictions was a war on suburbia.The fair housing division, led by a Texas Republican operative named Anna Maria Farías, became an especially toxic workplace, according to three former staff members with knowledge of the situation.Shortly after taking over, Ms. Farías informed her staff that she intended to root out “Obama plants” and froze antidiscrimination investigations involving large residential construction companies, including Toll Brothers and Epcon Communities, and an inquiry into Facebook’s online advertising division, among others.As part of the overall strategy of reducing regulatory action, Ms. Farías sidelined two of the unit’s most experienced managers, Bryan Greene, who had served as interim chief of the division, and Tim Smyth, a young lawyer working on some of the department’s most complex cases involving housing discrimination.Ms. Farías bypassed Mr. Greene, and stopped inviting him to meetings of his own staff. She marginalized Mr. Smyth in similar fashion, according to officials who worked with both men. The pair eventually left after being reassigned to jobs unrelated to major civil rights cases.Ms. Farías did not respond to an email seeking comment.Mr. Carson’s political staff aides, housed on the agency’s 10th floor, were, at times, unaware of these machinations, and not even knowledgeable about basic departmental functions, according to people who worked with them at the time.After Hurricanes Harvey, Irma and Maria in 2017, several Carson aides expressed surprise when told the housing department was responsible for disbursing billions in disaster assistance for tenants and homeowners whose dwellings were damaged by the storms, according to an aide who was present at a briefing session.For a while, their lack of knowledge worked to the benefit of career officials, who quietly slipped in Obama-era provisions to the aid rules — including a stipulation that rebuilding efforts conformed to green building standards.A flooded neighborhood in Beaumont, Texas, after Hurricane Harvey in 2017. Several aides to Mr. Carson were unaware that the department was responsible for disbursing billions in disaster assistance.Alyssa Schukar for The New York Times But the White House quickly caught on, further fueling suspicions there about the presence of a so-called deep state hostile to Mr. Trump’s agenda. Mr. Trump, in turn, began seeking opportunities in attacking the agency to make political points, slow-walking $20 billion in relief for Puerto Rico, then stonewalling investigators, according to the department’s inspector general.Frustrated staff members departed for private-sector jobs, taking their expertise with them, most notably Stan Gimont, a 32-year agency veteran with deep knowledge of federal disaster relief programs who was the top career official in the planning division.A long-running ideological fight over how best to deal with the worsening homelessness crisis resulted in other departures, led by the division’s director, Anne Oliva, in 2017. Others fled after religious conservatives began to focus on cultural rather than housing issues, like an edict in 2020 allowing grantees to deny shelter to transgender people.Even units with no policymaking roles were affected by the staffing shortfall.Late last year, the agency’s inspector warned that a 28 percent vacancy rate at the information technology division could compromise the personal information of millions of aid recipients. In her testimony, Ms. Fudge blamed the staffing problems at the unit for slowing the response to a recent virus attack that infected 750 agency computers.Ms. Fudge has expressed frustration at the amount of time she has to spend on recruiting and retaining staff, aides said. And while she had success wooing several high-profile staff though discretionary political hiring, the overall pace of appointments has been sluggish, and career civil servants, like Mr. Greene, have proved difficult to reel back in.Lawmakers in both parties, while expressing confidence in Ms. Fudge, said they were worried the department’s staffing problems might leave it unable to manage all the programs it had been given control over, especially if Mr. Biden’s big infrastructure bill passes.“I’m concerned that HUD lacks the capacity to manage and oversee such an influx of funding, regardless of how well intentioned those proposals may be,” Senator Susan Collins, Republican of Maine, who helped shield the department from deep budget cuts proposed by Mr. Trump and backed by Mr. Carson, said at the recent hearing. More