We come from the land of the ice and snow,
From the midnight sun where the hot springs blow.
The hammer of the gods will drive our ships to new lands,
To fight the horde, sing and cry: Valhalla, I am coming!
On we sweep with threshing oar,
Our only goal will be the western shore.
- Led Zeppelin, the Immigrant Song
I want to say a few things about immigrants. I'm a child of immigrants - legal immigrants, mind you - and I have my point of view.
Let me start with the concept of a country. There is a such a thing, and there is such a thing as a citizen. And there is such a thing as NOT being a citizen of a given country. Non-citizens have no rights to the resources of a country and none of the privileges and responsibilities of a citizen. As it should be.
By analogy, there is such a thing as a household, and there is such a thing as a member of that household. And there is such a thing as NOT being a member of a given household. Non-members have no rights to the resources of the household and none of the privileges and responsibilities of household members.
The analog can be extended to cities, counties, provinces, states, etc. Each person is in or out, either a member or not a member. At each level the members decide the rules for admitting non-members. And non-members have no rights to the resources of members, nor any of their privileges or responsibilities.
Given that, there is such a thing as a legal immigrant: someone who becomes a citizen of a country of which they were not previously a citizen, by following that country's laws. If an immigrant doesn't follow those laws then they are not a legal immigrant, and they are not entitled to the resources of the country nor to the privileges or responsibilities of its citizens.
Why do people immigrate? For many reasons, but at the highest level they want to be a citizen of another country so they have rights to the resources of a country, sharing the privileges and responsibilities of its citizens. Why does a country accept immigrants? At the highest level because those immigrants are or will be net contributors to the common good. In exchange for sharing its resources, the country is motivated by the net positive impact of having the immigrant as a citizen.
One of the most desirable aspects of being a citizen is the right to work. Conversely, an effective way to deter illegal immigrants is to enforce the laws which prevent them from working, by punishing employers who hire non-citizens. A "broken windows" approach to illegal immigration will be far more effective (and far less expensive) than mass deportations.
No country is obligated to accept any immigrants. And every country is entitled to filter the immigrants it allows to become citizens. If a prospective immigrant brings a net positive impact, great, and welcome. If not, then so sorry, not welcome. Immigration is a basic transaction between two willing parties.
What about newborns? Each country can determine how newborns become citizens, but it doesn't make any sense to base citizenship on the geographic location of a person's birth. Citizenship of a newborn should follow from the citizenship of its parents, regardless of where they are born. For cases where the parents' citizenship differs and when countries do not allow dual citizenship, then the child must choose their country when they reach adult age.
So, what to do about Middle Eastern refugees? There is no obligation on the part of any country to do anything. For humanitarian reasons a country may choose to help, but that is strictly a choice. In practice, there is no altruism. Countries allow refugees to immigrate because they want them, either to provide labor, or for their cultural impact, or for some other reason.
Being a refugee does not confer any entitlement to immigration.
What about Muslim immigrants? What should really be done? In this regard it's important to distinguish between freedom of religion and freedom of behavior. US citizens enjoy freedom of religion, but not freedom of behavior. Citizens must follow the law, which includes respecting the law. And this the problem with Islam, because it is more than a religion, it is also a legal system. Muslim immigrants who want to practice Sharia law cannot do so in the US. If they feel this violates their religious principles, then they cannot immigrate.
As a final thought, enforcement of a country's immigration laws is an essential responsibility of its leadership. If a US President doesn't agree with US laws, then s/he can work to get them changed, but in the meantime they should uphold those laws and enforce them. And they should most certainly not issue executive orders which contradict them.