Moses's wife was a Midianite. Solomon had many non-Jewish wives. Abraham married Hagar, who was an Egyptian.
If Jews shouldn't marry non-Jews, how were these prominent Jewish leaders able to do so?
The Torah commands the Jewish people not to marry the daughters of the 7 Cananite nations in Israel.
א כִּי יְבִיאֲךָ, יְהוָה אֱלֹהֶיךָ, אֶל-הָאָרֶץ, אֲשֶׁר-אַתָּה בָא-שָׁמָּה לְרִשְׁתָּהּ; וְנָשַׁל גּוֹיִם-רַבִּים מִפָּנֶיךָ הַחִתִּי וְהַגִּרְגָּשִׁי וְהָאֱמֹרִי וְהַכְּנַעֲנִי וְהַפְּרִזִּי, וְהַחִוִּי וְהַיְבוּסִי--שִׁבְעָה גוֹיִם, רַבִּים וַעֲצוּמִים מִמֶּךָּ. 1 When the LORD thy God shall bring thee into the land whither thou goest to possess it, and shall cast out many nations before thee, the Hittite, and the Girgashite, and the Amorite, and the Canaanite, and the Perizzite, and the Hivite, and the Jebusite, seven nations greater and mightier than thou; ב וּנְתָנָם יְהוָה אֱלֹהֶיךָ, לְפָנֶיךָ--וְהִכִּיתָם: הַחֲרֵם תַּחֲרִים אֹתָם, לֹא-תִכְרֹת לָהֶם בְּרִית וְלֹא תְחָנֵּם. 2 and when the LORD thy God shall deliver them up before thee, and thou shalt smite them; then thou shalt utterly destroy them; thou shalt make no covenant with them, nor show mercy unto them; ג וְלֹא תִתְחַתֵּן, בָּם: בִּתְּךָ לֹא-תִתֵּן לִבְנוֹ, וּבִתּוֹ לֹא-תִקַּח לִבְנֶךָ. 3 neither shalt thou make marriages with them: thy daughter thou shalt not give unto his son, nor his daughter shalt thou take unto thy son. ד כִּי-יָסִיר אֶת-בִּנְךָ מֵאַחֲרַי, וְעָבְדוּ אֱלֹהִים אֲחֵרִים; וְחָרָה אַף-יְהוָה בָּכֶם, וְהִשְׁמִידְךָ מַהֵר. 4 For he will turn away thy son from following Me, that they may serve other gods; so will the anger of the LORD be kindled against you, and He will destroy thee quickly.
After the First Exile, Ezra explained this verse to mean the daughters or sons of any non-Jewish nation.
In Chapter 9 of Ezra, Ezra complains that the Jewish people have married all sorts of foreign women, including from the 7 nations.
In Chapter 10 of Ezra, It is decided that they will repent, and make a fence and not allow any intermarriage at all.
All examples of Jewish Leaders marrying non-Jews in the way of European Kings, happened before the Decree of Ezrah.