Hello; This is a sticky point. The issue is clouded by the fact that almost all ( maybe all) the people who have committed terrorists acts from these countries are known to be part of the religion. I heard it stated this way once - Not all muslums are terrorist, but all terrorists are muslum. That may not be a totally accurate statement, I don't know if all terrorists have been muslum. I think the point is by blocking potential terrorists from these countries, you then by default block folks of muslum faith.
There are two ways to look at it. One is that the intent is to block people due to their religion. The other is that the intent is to block potential terrorists only. Either way the results will look the same.
An example. Some folks believed the sun went around the earth. Other people believed the earth spun on it's axis and went around the sun. Two different theories but to a guy on earth watching sunrise to sunset either will fit his observation.
Hello; That is the point of the travel ban (to me anyway). That we do not have a good way to filter out the bad people right now. We may never be able to find all of them, but at least the effort should be made.