And, you are part of a social contract between these other people you live with (e.g. your countrymen) where you can't just override them.
If you had your own country where nobody else lived, where you had no social contract with anyone, it would be fine for you to let anyone in (of course, you wouldn't have a country for long).