Who or what differentiates to mere mortals what is recorded as historical, and what God intended? Pope or preacher? A particular chapter or verse?
If I was to be "Loving God for a Day" and had certain intentions, I would make things far more clear and unambiguous.
For example if I intended "one man one woman" I wouldn't have so many stories and examples to the contrary.
None of us would have written the Bible the way it is. That's one of the ways we know it's really God's word. It's beyond the scope of the human imagination, or character. (Would the writers of the Gospel have written of their sin, fear and misbelief if they were trying to get converts on their own? That's actually one of the proofs that it's authentic).
The fact is that there are a lot of events depicted in Scripture that are outside of the will of God. (Think David) They are the historic record of what people did, and how they behaved. What happened. In fact, Solomon's excesses led to his downfall. Abraham's taking a second 'wife' was a grievous sin. David's polygamy was also sin.
The truth is that the much of the Old Testament is just historic record (most of Samuel, Kings, Chronicles). It says what happened.
It's not written for our convenience and ease. We are expected to study, and study hard to understand what it means. That's why a casual viewing of it can lead one to believe that there are contradictions and errors. There are not. Just human misunderstanding.
The early church fathers divided its content into categories: the Pentateuch, Psalms (songs), Prophesy: major and minor prophets, History, the Gospels, the Epistles. From that, or from just reading it ourselves, we can see the purpose of each section.