Have you read that? It's fairly specific on who may or may not be denied a visa.
What it says is that if someone is known to be a terrorist, or known to have engaged in terrorist activities, or had military training with a terrorist group, then they may be denied a visa. And it goes on to define that "terrorist" means.
It in no way authorizes the banning of the issuance of visas, temporarily or permanently, based solely upon the religion of a person.
You are 100% wrong in your assertion that religion is enough to trigger the suspension of visa issuance.
It's you that didn't read it. The US would not have to use a religious measure- but any nation state that supports, either by out right support, or passive support, would b reason enough. It is Islam that makes it religious, not the US.
There are plenty of legal arguments to support a temporary ban on visas.