There have always been rules about being admitted into the US and about becoming a citizen; and the basic principle for both is that you can’t come into the US if you’re an enemy. (Unless you’re covered under diplomatic rules; and even that usually isn’t allowed in time of war, except maybe for purposes of peace negotiations.)
Here’s the text of my great-great-great’s naturalization papers.
UNITED STATES OF AMERICA.
State of Ohio, Darke County, SS.
Court of Common Pleas, _October_ Term, 185_7_.
Be it Remembered, That _Cornelius O’Brien,_ a native of _Ireland,_ and now a resident of this county, has this day come into Court, and made application to be fully Naturalized and to become a citizen of the United States; and it appearing to the satisfaction of this Court that the said _Cornelius O’Brien_ did on the _22nd_ day of _July,_ A. D. 18_54,_ declare his intention to become a citizen of the UNITED STATES.
And this Court being satisfied by the oaths of _John Shayne & Michael Hamish,_ that the said _C. O’Brien_ has resided within the United States five years, that he is of good moral character, that he is attached to the principles of the Constitution of the United States, and well disposed to the good order and happiness of the same, and the said _C. O’Brien,_ being admitted by this Court, took the oath to support the Constitution of the United States of America and that he doth now absolutely and entirely renounce and abjure all allegiance and fidelity to every foreign Prince, Potentate, State or Sovereignty whatsoever, and particularly to _Victoria, Queen of Great Britain & Ireland._
This is Therefore to Certify, That the said _Cornelius O’Brien_ has complied with the laws of the United States, in such case made and provided, and he is therefore admitted to be a citizen of the United States.
In Testimony Whereof, I hereunto set my hand, and affix the seal of said Court at Greenville, this _8th_ day of _October,_ A. D. 185_7._
_S. H. Robison,_
Clerk Court Common Pleas, Darke Co., Ohio.
So there you go. He had to be of good moral character – ie, not a criminal or a layabout. He had to believe and stand by the US Constitution and its principles, and to swear to support it. He had to be “well disposed” to law and order under the Constitution, and to the happiness of all the states united under it. He also had to swear that he renounced all foreign allegiances (since he wasn’t eligible for a dual citizenship) to all other forms of government. Since he was an Irish nationalist who allegedly fled Ireland rather abruptly, renouncing Ireland was a big deal for him. (Renouncing Queen Victoria, not so much!) Since he ended up fighting as a volunteer for the Union a few years later, you can see that he didn’t take his new allegiance lightly.
There was a time when folks in the US thought that maybe Catholics had a temporal and political allegiance to the Pope as the temporal head of the Papal States, and later, as the temporal head of Vatican City. This was eventually ironed out, mostly by Catholics showing their loyalties through their actions, and through being Catholic and American both. (Some Catholics may have gone too far in taking their religion out of the public square, which of course was unwise.)
If Muslims want to be citizens of the US, they can’t pledge allegiance to any present-day caliphate or be working for such a thing. If people decide they want to be loyal to another government, there is such a thing as renouncing one’s citizenship and leaving. Otherwise, you need to buckle down, and be a good citizen of the US and demonstrate the civic virtues.