I think there are about 500K Homeless in America, would it make sense to first offer about 20K of them some free housing?
If you think this is some gotcha (you can't help with Afghan refugees during a crisis until you've solved homelessness ?) then you never cared about the homeless in the first place, and are using them as a pawn when it's useful to dunk on the middle east.
That's a bit presumptuous, don't you think? There's nothing inherently contradictory about "we need to look after americans before look after refugees" and "we need to do something about homelessness". The only contradiction is that the former is a policy of one political party, and the latter is a policy of the other political party.