Neither refugees nor illegals, but complying with the Roman edict to return to their town of birth for the census (taxation). Joseph was of the House of David, and returning there. This wondrous child was brought gifts of Gold, Frankincense, and Myrrh, all valuable. They were not going to starve.
Besides, God had a plan, and that day of Christ's birth made an eternal gift to all who would listen.
It is awful when the leftists try to conflate that which is as good as good gets with their efforts to harm this nation and to loot it for their personal and political gain. It is a low form of deception used to prey on the uninformed.