Here’s why it happened: Because once Trump said he would sign an executive order paying TSA, an order which of course would not fund ICE, that made it ok for them to pass something that did not fund ICE.
“Shortly after 2 a.m., Senators approved a measure by unanimous consent that funds all of the DHS except for Immigration and Customs Enforcement and Border Patrol, terms Democrats had been insisting on.”
Source