Paul tells us all Scripture is “God-breathed” (2 Timothy 3:16-17), and we believe that.

But what does that mean?
One answer has to do with origin—it means the Scripture ultimately comes from God rather than man. This is Peter’s point in 2 Peter 1:19-21. Even in instances where the writer “carefully investigated” his subject matter as Luke did (see 1:1-4 of his gospel), we understand that the Spirit was involved in the process, so that what was written was what God wanted. I think this also applies to passages like 1 Corinthians 7:25ff where Paul tells us he has no word from the Lord but offers his “judgment.”
Then there’s material like the book of Job. On anyone’s view, much of what Job’s friends say isn’t accurate—but we understand that God wanted it recorded so we could learn from negative examples as well as positive ones. This is why Satan’s lies, the falsehoods of various people, and bad examples are all part of the scriptural record. But we understand this, and few people give it a second thought.

Then there’s the psalms. Someone said the psalms are not about God speaking to people, but people speaking to God. While there are exceptions to this, this is generally true and helpful way to look at the psalms. It’s also clear (as with the other writings), that the Spirit superintended the whole process. Therefore, when the writer goes off the rails (as can happen in the book), we don’t need to get twisted into knots about it. God is allowing someone to speak their mind even though it might be clouded by suffering, oppression, immaturity, or emotion. In such instances, we’re not to look to their words for doctrine or example, but rather to appreciate and learn from the journey of the human spirit struggling to become a holy spirit.
But doesn’t all this muddy the water and require us to work harder to understand the Scripture? What can’t it just be simpler?
It does mean that we must be thoughtful in our approach to God’s word . . . and yes, that can take some effort. As to why it’s that way, you’ll have to take that up with the One who gave it to us. I do know this: if the Bible is the book of life and for life, then we should expect it to be like life—straightforward and simple at times but layered and nuanced at other times—but always life changing. After all, our goal isn’t to go through the word of God—it’s to let the word of God go through us!