According to the
Catechism of the Catholic Church (1867):
The catechetical tradition also recalls that there are “sins that cry to heaven”:
Among this set of grave social sins in our sacred tradition is "
The cry of the foreigner, the widow, and the orphan", the OT biblical references for which is commonly given as:
Exodus 22:21–24
21 “Do not mistreat a foreigner or oppress him, for you were foreigners in Egypt. 22 “Do not take advantage of a widow or an orphan. 23If you do and they cry out to me, I will certainly hear their cry. 24My anger will be aroused
And the NT reference, of course, being Luke's Parable of the Good Samaritan:
Jesus answered, "A certain man was going down from Jerusalem to Jericho, and he fell among robbers, who both stripped him and beat him, and departed, leaving him half dead. By chance a certain priest was going down that way. When he saw him, he passed by on the other side. In the same way a Levite also, when he came to the place, and saw him, passed by on the other side.
But a certain Samaritan, as he travelled, came where he was. When he saw him, he was moved with compassion, came to him, and bound up his wounds, pouring on oil and wine. He set him on his own animal, and brought him to an inn, and took care of him. On the next day, when he departed, he took out two denarii, and gave them to the host, and said to him, 'Take care of him. Whatever you spend beyond that, I will repay you when I return.' Now which of these three do you think seemed to be a neighbour to him who fell among the robbers?"
He said, "He who showed mercy on him."
Then Jesus said to him, "Go and do likewise."
— Luke 10:30–37,
World English Bible
A nice summation of Catholic doctrine on this was made by Pope Pius XII in 1952:
papalencyclicals.net/Pius12/p12exsul.htm
EXSUL FAMILIA NAZARETHANA
Apostolic Constitution of Pius XII, dated August 1, 1952.
You know indeed how preoccupied we have been and with what anxiety we have followed those who have been forced by revolutions in their own countries, or by unemployment or hunger to leave their homes and live in foreign lands.
The natural law itself, no less than devotion to humanity, urges that ways of migration be opened to these people. For the Creator of the universe made all good things primarily for the good of all. Since land everywhere offers the possibility of supporting a large number of people, the sovereignty of the State, although it must be respected, cannot be exaggerated to the point that access to this land is, for inadequate or unjustified reasons, denied to needy and decent people from other nations, provided of course, that the public wealth, considered very carefully, does not forbid this.
And also:
vatican.va/roman_curia/pontifical_councils/corunum/documents/rc_pc_corunum_doc_25061992_refugees_en.html
PONTIFICAL COUNCIL
FOR THE PASTORAL CARE OF MIGRANTS AND ITINERANT PEOPLE
REFUGEES: A CHALLENGE TO SOLIDARITY
PRESENTATION
1992
“A shameful wound of our time”
From this some key points:
"…(1) Protection of refugees is a duty and responsibility for the Christian
Protection is not a simple concession made to the refugee: he is not an object of assistance, but rather a subject of rights and duties. Each country has the responsibility to respect the rights of refugees and assure that they are respected as much as the rights of its own citizens…Any person in danger who appears at a frontier has a right to protection. Indifference constitutes a sin of omission.
(2) The immediate needs of the refugee transcends the interests of the State and even national security in deference to the dignity of the refugee as a human person:
The problem of refugees must be confronted at its roots, that is, at the level of the very causes of exile. The first point of reference should not be the interests of the State, or national security but the human person, so that the need to live in community, a basic requirement of the very nature of human beings, will be safeguarded…While moments of economic recession can make the imposition of certain limits on reception understandable, respect for the fundamental right of asylum can never be denied when life is seriously threatened in one’s homeland…"
(3) National interest should not be the overriding concern:
Despite an increased awareness of interdependence among peoples and nations, some States, guided by their own ideologies and particular interests, arbitrarily determine the criteria for the application of international obligations…
However, numerous people within various nations are taking firm position against selfish attitudes and the adoption of policies of restrictionism, and who are committed to sensitizing public opinion in favor of the protection of the rights of all and of the value of hospitality…
Such an attitude facilitates the search for common solutions and undercuts the validity of certain positions, sometimes put forward, that would limit acceptance and the granting of the right of asylum to the sole criterion of national interest…"