“...but the Constitution doesnt apply to non-citizens.”
IMO, that is the way it “should” be. But the courts have held....
We look to what the Constitution does or doesn’t say.
Unless the words of the Constitution expressly sets apart it’s protections to US citizens only, it protects non-citizens here too.
Which is pretty much what the Courts have held. But I would submit that Congress has the authority to regulate non-citizens, and in fact Congress has given the President authority over immigration.