Faith in God Is Useful for Society
If no one watches a child, the child sometimes behaves badly. The child does something that is not allowed, even though the child knows it should not be done. But when the child knows that the parents are watching, the child does not behave badly, or does it much less. The child knows there may be punishment.
Then children grow up and become adults. If there is no watcher and no feeling of punishment, adults also behave badly.
Faith in God, in this context, is faith in a watcher and punishment.
Let us say the authorities bring in a new law that does not go against the religion of society. Then people who believe in God will try to follow the law, no matter the situation, among others or alone. But if a person does not believe in God, then in most cases this person will break this law when alone.