He espoused the benefits of universal prekindergarten, which he had instituted in San Antonio when he was mayor, and proposed taxing the inherited wealth held by the country’s top earners. And his relentless focus on how to help the poor — encapsulated by a plan to end hunger — won him support from those who saw him as a fierce advocate for the underserved and underrepresented.
But Mr. Castro never found his footing in the polls, rarely exceeding 2 percent support in national or early-voting state surveys. Although he participated in the first four primary debates, he did not make the cut for those that followed. Weeks before the qualification deadline for the November debate, he warned that if he could not raise more money, he would end his campaign. Although he raised more than $800,000, meeting the goal he had set, he never got the polling boost he needed.
The absence of Mr. Castro’s voice from the debate stage was widely noted, and he gained attention in recent weeks with his call for a reordering of the Democratic primary schedule, arguing that Iowa and New Hampshire, whose largely white populations vote first, did not represent the demographics of the country.
He was outspoken when Senator Kamala Harris of California made a surprise exit from the race in early December, saying that “Kamala was treated very poorly” and had been “held to an unfair standard” by the media.
“The media’s flawed formula for “electability” has pushed aside women and candidates of color,” he said that day on Twitter. “Our party’s diversity is our strength.”
For some, Ms. Harris’s departure bolstered the case Mr. Castro had been making about the primary system. On the day she announced she was dropping out, Mr. Castro had his best fund-raising day of the quarter.
Mr. Castro’s concerns about the field’s diminishing diversity were amplified again in the days leading up to the December debate, when nine of the Democratic candidates, including Mr. Castro, signed a letter to the D.N.C. asking officials to lower the thresholds to qualify for the party’s January and February events. The letter noted that many of the candidates who had helped make the Democratic field diverse had been “excluded.” And indeed, the December debate featured six white candidates and only one person of color, the businessman Andrew Yang.
Mr. Castro, a third-generation Mexican-American who has endured repeated scrutiny over his lack of Spanish fluency, ended his last campaign video with a message to supporters:
“Ganaremos un día!” The translation is offered only in the subtitles: “One day we’ll win!”



