- 1A limits what congress may do, "Congress shall make no law...". It does not positively define what people may do, and therefore doesn't pick out a class of people to whom it applies.
- It is settled that the U.S. government may condition immigration-related decisions on your speech and actions. They don't have to let in an Al-Qaeda member when he shows up at the border, and they don't have to give a pro-HAMAS agitator in the country on a temporary visa a green card. It's still not totally clear to me if a green card might have some sort of special-but-noncitizen status, and maybe it's not clear in general.
- The U.S. government asks people who are applying for entry or a visa questions like, "Are you a terrorist, or have you ever belonged to or supported terrorist organizations?". Part of the reason they do this is to catch you in a lie if it then turns out that you are e.g. supporting HAMAS. If you lied on your immigration documents, they can throw you out.
- For this reason, it seems like e.g. refusing to renew a visa on the grounds of HAMAS support would be fine. But maybe canceling a visa and kicking someone out wouldn't be fine?
sorcerer-ma’s comment made it sound like we are speaking of Mahmoud Khalil and others.
I am under the impression that the settled law is that 1A applies to everyone physically present in the country.