Because this is a society. In society, there is a contract where people contribute to the general welfare of the whole society.
If we enforced the law, I would agree with you but we are not a society, we are a free for all mob where anyone can just walk into this country.
Every time a poor person enters our country, we dilute everyone's wealth.
Every time we allow cheap imports we sabotage a poor person's job prospects.
If our borders where secure, we could provide housing, education and yes, health care too if everyone where gainfully employed that was able to work.
Wages would rise if we had to produce everything we use here.
When there is no limit on who "society" is, the contract is void.
The more we give folks, the more people will come to eat at the table.
The mob will clear the table like locusts.
Only a fool would put food on the table in a situation like this.