We find the same thing in the book of Malachi, as the prophet is dealing with the people with respect to their religious formalism and hypocrisy.
You have wearied the Lord with your words, yet you say, 'how have we wearied him?' In that you say everyone who does evil is good in the sight of the Lord, he delights in them; or where is the God of justice?(Malachi 2:17). You see, God is saying, you wearied me with this trash talk about me, by describing to me injustice, by saying that I ignored you or that I reward the wicked. He picks up the same thing again in Malachi 3:13–15:Your words have been arrogant against me, says the Lord, yet you say how have we spoken against thee? You said, it is vain to serve God, and what profit is it we have kept his charge; we have walked in mourning before the Lord of hosts. So now we call the arrogant blessed, not only are the doers of wickedness built up, but they also test God and escape.You see, God has put them into circumstances with which they are not pleased. They look around them and see that the wicked are prospering. And so what is the temptation? The temptation is: God must not be just. God must care for the wicked more than me. God must not really love his people and honour them in the midst of their trials. The Lord is angry with these arrogant and wicked words. That is the principle that James is setting before us in James 1:16. To speak evil of God sets our lives in a course of action to think evil of God. To ascribe wrong motives to God sets our lives on a course of action that will move us in a completely opposite direction from fellowship and communion with God.1
Joseph A. Pipa
16 Do not be deceived, my beloved brothers.