Actually, Elihu is not one of the men that God chastises, in the book of Job, but more on that in a second.
Job is one of the least-understood books of the Bible, as the popularity of the phrase “the patience of Job” proves. Job is many things, but he is NOT patient! On the contrary, he’s a man who screams and rails at God, demanding an explanation for his pains and suffering.
Three Edomites, members of a race that was once esteemed for wisdom and philosophy, offer poetic justifications for God, the kinds of pious platitudes that well-meaning people ALWAYS try to offer us when we’re suffering. And Job responds with the sarcasm most of US are tempted to use, when hit with such platitudes.
The Bibles’ language is poetic, but I’m going to put it crudely:
Job: “Come on God, tell me wha this is all about? I’ve been good my whole life! I’ve never done ANYTHING wrong! I don’t deserve this! Come down here, and face me like a man, and tell me why you’re doing this to me!”
Friend 1: “Do not speak ill of the Lord, for the Lord is good, and sees all things, and his mercy is everlasting. Everything that happens is God’s will, so everything that happens is good.”
Job: “Oh, that’s brilliant! Thanks a heap, Socrates! Come on, God- after all I’ve done for you, is THIS how you repay me?”
Friend 2: “The Lord is kind, and in the end, you will see his justice. What SEEMS like evil is really good, for it is all God’s will.”
Job: “Oh, THAT’s a lot of comfort, Einstein. Is THAT supposed to make me feel better? Come on, God, I’m waiting for an answer!”
Friend 3: “God has his reasons for everything, for he is mighty, and his ways are too mysterious for us.”
Job: “Geez, and you guys are my friends??? Is that all you can give me? A bunch of inspirational, fortune-cookie cliches? I’ve honored God and lived a good life. I want to know why I should be suffering like this, if God is so good.”
At THIS point, a young man named Elihu interjects with his own take on the subject. He’s tired of listening to the wise men offer such lame defenses of God. Elihu chastises Job by pointing out:
“So what, if you’ve been good? So what, if you’ve been kind to the poor? So what, if you’ve offered sacrifices? Does any of that really help GOD? Is GOD any better off as a result of your actions? NO! Human actions can only help or hurt other humans. Don’t kid yourself that God OWES you anything, because of your actions.”
FInally, of course, God offers his own soliloquy. You can all read it for yourselves, but it all boils down to one thing: “I’m God, you aren’t. This is MY world, MY creation, and you just live in it. I have my reasons for everything, I have my plans. YOU don’t understand it, but you just have to trust me.”
At this, Job relents, and says, essentially, “You’re right. I’m sorry.”
But, as the OP says, God isn’t angry with Job at all- he’s angry at the self-styled philosophers who tried to defend the indefensible, by positing that it was God’s will. God tells them, “You have not spoken rightly of me, as has my servant Job.”
So… God is saying that Job, the angry blasphemer, the man who railed against Him, was speaking correctly! Does that make sense?
Well, yes, actually, it does. “Prayer” is communicating with God, and whatever his faults, Job NEVER stopped praying. Even yelling at God, and complaining about injustice constitues prayer!
In short, whether you’re a believer or a non-believer, I suspect the moral is that God prefers those who HATE to see misery and injustice, and want to see an end to it, over those who see misery and injustice, and accept it casually as God’s will.