We are all born to the systems of the location we are born into.
If a country has built up the systems it wishes to live under by communal agreement. Why should others be allowed to enter that country and change the way those people live. Why does an immigrant take the rights to live the way they lived in one country into another,
The rules/guidelines/laws/ morality of that nation are entitled to protect their way of life. When someone migrates to another country they should live by the laws of that land. The law of the land overrides all other laws,
To protect itself a country can close its borders. Not only in the way said above, But for the interest to its stability, Permitting everyone to enter a country without restriction will bankrupt a country. The resources and finance to support everyone is not there for any country.
Sovereign country have the right to control their border.
We can argue for or against borders, but while we have them, we can control them.
Usually a democratic government decides based on their democratic mandate.
Citizens vote their representatives and the representatives vote based on a platform they were elected on.
As long as you have separate governments with different goals in mind, looking out for benefit of different populations, you should probably have borders.
The government in theory holds absolute power over the borders because they are given that power when they get elected, most constitutions around the world say it's something about protecting the sovereignty of the country and protecting the people but in practice absolutely closing borders is almost impossible to do unless your border is small enough or heavily militarized.
1. When there is a national threat.
Immigrants can be a threat to national security because it's difficult to tell if the people you're trying to let in your home are harmless or just waiting for your to turn your back.
2. When there is a higher priority for safeguarding it's own citizen's welfare.
Introducing immigrants may mean allocating more resources to accommodate them. If a country is already strained of its own resources, it is reasonable to close borders than invite for conflict.
A country has a primary responsibility of safeguarding the welfare of its citizens before thinking about extending help to any foreign entities.