They aren't "illegals". They're legal asylum seeking immigrants.
The money is also not going to them. It went primarily to healthcare providers providing basic care. The remaining amount mostly went to providing shelter, food and other infrastructure, which again ended up paying the people...