Full Idea
It is asserted that those who first led mankind …invented gods as watchers of all the sinful and righteous acts of men, so that none should dare to do wrong even in secret.
Gist of Idea
Gods were invented as watchers of people's secret actions
Source
Sextus Empiricus (Against the Physicists (two books) [c.180], I.016)
Book Reference
Sextus Empiricus: 'Against the Physicists/Against the Ethicists', ed/tr. Bury,R.G. [Harvard Loeb 1997], p.9
A Reaction
Sextus is a sceptic about everything, so this scepticism about the gods is nothing special. I'm not sure if this is why the gods were invented, but it seems to be the main role assigned to God by the Christian church, as the basis of religious morality.