Most religions build on the concept of “community” as one of the building blocks of the religion. As @Nullo said, the catholics make it a sin. Orthodox Jews are commanded to pray with others (hence the idea of a minyan), and so on and so forth. Just about all religions urge, if not require, community prayer.
But there’s more to it than that. The cynical view is that community prayer (going to church or synagogue) is really more about lifetime employment for clergymen, and more opportunities for fundraising, than it is about religion, faith, or belief.
Consider this – if no one went to church, would the priest still have a job? So it is in the priest’s best interest to keep his pews full in order to justify his continued employment. Is it necessary for a prayer to be heard with a group? No. But it is necessary if they clergy man wants to keep his job.
Along the same lines: if you are in church, you are a ripe audience for fund raising appeals. If you’re not in church, then the chances of you contributing go WAY down. So again, there is an economic incentive for encouraging church attendance.
Religion: It’s all about the money,