וְעַתָּ֗ה יִֽשְׁמַֽע־נָא֙ אֲדֹנִ֣י הַמֶּ֔לֶךְ אֵ֖ת דִּבְרֵ֣י עַבְדּ֑וֹ אִם־יְהוָ֞ה הֱסִֽיתְךָ֥ בִי֙ יָרַ֣ח מִנְחָ֔ה וְאִ֣ם ׀ בְּנֵ֣י הָאָדָ֗ם אֲרוּרִ֥ים הֵם֙ לִפְנֵ֣י יְהוָ֔ה כִּֽי־גֵרְשׁ֣וּנִי הַיּ֗וֹם מֵהִסְתַּפֵּ֜חַ בְּנַחֲלַ֤ת יְהוָה֙ לֵאמֹ֔ר לֵ֥ךְ עֲבֹ֖ד אֱלֹהִ֥ים אֲחֵרִֽים׃
Now therefore, I pray thee, let my lord the king hear the words of his servant. If it be the LORD that hath stirred thee up against me, let Him accept an offering; but if it be the children of men, cursed be they before the LORD; for they have driven me out this day that I should not cleave unto the inheritance of the LORD, saying: Go, serve other gods.
Mishneh Torah, Kings and Wars
A person should always dwell in Eretz Yisroel, even in a city where most of the residents are not Jewish, rather than live outside of the Land in a city where most of the residents are Jewish. For anyone who leaves the Land is considered as if he worships idols, as it says, “for they have driven me out this day that I should not cleave to the inheritance of the Lord, saying, ‘go serve other gods’” (I Samuel 26:19). And regarding the calamities it says, “Neither shall they enter into the land of Israel” (Ezekiel 13:9). Just as it is forbidden to leave the Land, so it is forbidden to leave Babylon for any other country, as it says, “They shall be carried to Babylon, and there shall they be” (Jeremiah 27:22).