Gives a sense of community and cultural connection that other things don’t quite provide.
I’ve met a not so inconsequential amount of people in my life that when pressed admitted, they don’t believe in god, don’t believe in the moral teachings, but attend a place of worship because they think there is no replacement for the interwoven community and cultural connection their place of worship provides. Many people simply like the community connection of their root culture. This is especially true in minority groups (black church, synagogue).