In a closed-door meeting with the Democratic caucus on Tuesday morning, three lawmakers stood up to describe their concerns with the package: Representatives Joaquin Castro of Texas, the chairman of the Hispanic Caucus, Pramila Jayapal of Washington, a co-chairwoman of the Progressive Caucus, and Ruben Gallego of Arizona. The Hispanic Caucus, fueled by two-thirds of its 38 members, announced its opposition to the bill shortly afterward, as did the Progressive Caucus.

Mr. Gallego said he had told Ms. Lowey earlier this month that “the status quo is not acceptable” when it came to funding the immigration policies, including allowing the administration to reallocate funds from other programs to build the border wall and raise the number of migrants in detention over the levels set by the spending bills.

“I told her today in this caucus again, that she has to go find Republican votes, because I’m not voting for it,” he said on Tuesday. Mr. Gallego argued that another short-term spending bill would have been preferable to the package put forward by Democrats, though other lawmakers have argued that full-year funding bills offer agencies the stability agencies and departments need to plan and develop programs.

Other members of the Democratic caucus grappled publicly with their choice between voting no to register their opposition to immigration policies they detest or supporting the measure to maintain funding for other national security programs and avoid another government shutdown.

Representative Debbie Mucarsel-Powell, Democrat of Florida and a member of the Hispanic Caucus, called it a “heart-wrenching” decision to vote for the measure, while Representative Lucille Roybal-Allard of California and the top Democrat responsible for the Department of Homeland Security bill, acknowledged that “we’re all frustrated” with the border wall funding that remained and the lack of restrictions on Mr. Trump’s ability to transfer funding. Ms. Roybal-Allard, a member of the Hispanic Caucus, voted against the package, a rare gesture for a subcommittee chairwoman.

Mark A. Morgan, the acting commissioner of Customs and Border Protection, said he was frustrated that certain lawmakers, including those from border states, were pushing back against the spending package.

“One hundred percent I’m disappointed — absolutely,” Mr. Morgan told reporters on Tuesday. “When I see Congress not be able to get together on a bipartisan manner to be able to fund what I see as an essential tool to perform our duty? To protect this country? Damn right I’m disappointed.”