Although true religion can be prescribed, it can never be automated.
There is no mechanical predictability in the way we interact with our Maker. It is true that we must do the right things. But this does not mean that performance of the right actions simply elicits from God the response we require.
On the contrary, motive matters.
In fact, biblical wisdom is even more severe than this. Doing the right thing from out of a wicked life is more than just ineffective. It is a provocation.
The sacrifice of the wicked is an abomination; how much more when he brings it with evil intent. (Proverbs 21:27 ESV)
Biblical wisdom dares to suggest that manipulating the deity without reflection upon one’s own ethical status is one of the worst kinds of hubris. It is detestable, which is the meaning of ‘abomination’.
Yet it’s possible to lay blame for this misdeed at the feet of simple ignorance about how things really are. For all their devious intelligence, the wicked are sometimes stunningly naive about reality.
The second half of the proverb declares an offense even more grave than this kind of ignorance. When the wicked person actually schemes to move God’s arm against the innocent—when not merely culpable ignorance but actual intent to turn the Righteous One to unrighteousness lies at the root of religious activity—then the worshipper becomes the worst of sinners.
In the ancient world, as in ours, there are few true atheists. Unbelief takes the form of distorted faith more often than no faith at all. Atheism is more commonly practical than conceptual.
Its too common manifestation is attempted manipulation of YHWH, one of self-absorbed religion’s ugliest children.