Yep, undermines the hell out of freedom of conscience. The government should regulate actions, not belief- especially not political or religious belief.
I don't remember whether "I have not been affiliated with a terrorist organization" is on the immigration questionnaires. If it ain't, it needs to be put on there. That way you can just slap immigration/visa fraud charges at least against the troublesome immigrants that slip through (well, the statute of limitations for visa fraud is 5 years, so it's not perfect- just ask Melania Trump).
Yeah, that's the main problem I see with this, it's not (and shouldn't) really doable, however, this is one of the more reasonable things Trump has said on immigration, sounds like something a Democrat would do.
@francisco: that's the point. That's how you get them for immigration fraud.
Right now, USCIS asks you questions like whether you've ever been affiliated with the Communist Party of the Soviet Union. If you have- either you say yes, get it cleared (or get rejected)- or you lie and now can be deported for visa/immigration fraud if caught within 5 years. You've already committed perjury at least.