H.l. Mencken said this quote

Yet the same thing happens to the notions of morality. They are devised, at the start, as measures of expediency, and then given divine sanction in order to lend them authority.