Psalm 107 opens with a picture of people who were "wandering in the wilderness in a solitary way; they found no city to dwell in" — homeless and directionless — and then describes God leading them to "a city of habitation" (v.4–7). The psalm presents this as a characteristic act of God: taking the homeless and giving them a place to dwell. The Hebrew moshab — habitation — is a place of settled dwelling, not temporary shelter.
Matthew 25:35 records Jesus' identification with those who needed housing: "I was a stranger, and ye took me in." The word xenos — stranger — in Greek carries the sense of the displaced, the person without a fixed place. Jesus identifies himself with the person in homeless recovery. God does not regard the homeless from a distance; by Jesus' own statement, he is one of them.
Commentary is from a charismatic Protestant perspective, drawing on KJV text and public-domain sources including Spurgeon, Andrew Murray, and Matthew Henry.