I'm no religious person, but I would imagine praying in a mosque is very different to personally knowing everyone else that's praying in the same mosque. Even if you do meet everyone it's not like they're gonna introduce themselves with "hi, I'm $stereotypicalMuslimName, and I plan on doing a terrorist attack next month".
The connection needs to be far more substantial than that to warrant surveillance.
It's similar to a school. You might have a social group of a dozen peers you're familiar with, and you might or might not ever do anything outside of school with those people. There are also hundreds of other students in different sets or levels of classes who you might not ever learn the name of.
Of course, it will vary between large churches and small churches, and probably between areas with lots of churches and areas with only a few. But I wanted to explain that since it sounds like you had at least an exaggerated idea of how religious people socialize via their places of worship.
Also, some tiny question: People you think you associate with or people the Police think you associate with?
When investigating serious crimes, there is no such thing as too much information. If you say hello and chit-chat with Bomberman every Sunday, I want to know what you talk about, I want to know what he wears, when he was sick and didn't show up, I want to know how he smells, I want to know everything, and given that you associate with him, I was hoping you could provide some information.
I mean, we're talking about tracking those hanging out at places where terrorists are known to gather, and associating with said terrorists, however casually? That's just military sense. Are we just supposed to let the known terrorist go to the bar, have his/her coded conversations with an unknown subject, and then let that subject go on his/her merry way without looking any further into the matter? That would be naive in the extreme.
Secondly, no one's suggesting that they let everyone go their merry way without looking into anything. Only that widespread surveillance must be justified e.g. the evidence must pass some threshold and other responses have been ruled out.