The naive answer:
God was explaining things to his people using information his people at the time could understand.
The problem with the naive answer:
The Bible claims to have answers that are true for all people of all times. If the Bible is for all people, it should relate to all people. Most of the mistakes in the Bible could be easily rephrased to convey the same meaning without containing factual errors.
The scholar’s answer:
Human’s wrote the Bible and their knowledge was limited by the small part of the world they knew.
Here are a few examples of mistakes:
Matthew 13:31-32 Jesus said the smallest seed is the Mustard seed.
Revelation 7:1 The Earth has four corners.
God created Adam and Eve but had to start over with Noah and his family. Surely this was a mistake because he knew what the descendants of Adam and Eve would do and he even knew that he would have to kill nearly everyone in the world with a great flood. God could have started the world with Noah. God made people then drowned them all in the flood. He knew he was going to have the flood and he knew he would be killing all of those people, yet he created them so he could kill them anyway. Their lives served no purpose except to give him the pleasure of killing them. (If all is to God’s purpose, then that was God’s only purpose.)
All of science confirms the Earth is older than the 6,100 years claimed by the Bible’s estimated date of creation (as calculated by Bishop Ussher). All of science confirms the Earth is millions to billions of years old. These sciences include physics, chemistry, biology, anthropology, cosmology, geology, and archaeology.
God is not omnipotent.
God does a poor job designing humans with so many flaws and weaknesses.
God did not provide guidance in the Bible to tell us not to enslave one another.
God did not provide guidance in the Bible to treat women as equal to men.
God did not provide guidance in the Bible to tell people to wash their hands after defecating or tending the sick.
God allows animals to torture other animals in cruel ways while eating their prey or using their prey to build homes for their offspring. This happens even when humans aren’t around to observe it, so there can be no lesson in it for humanity. It is just unnecessary cruelty, unless God had no way to prevent it.
Jeremiah 2:30 God admits that his punishment of his people failed. - “I have punished your children, but they did not respond to my discipline.” God killed people fully knowing that it would not induce the desired behavior. God killed people knowing it was done for no reason and to serve no purpose. He killed just for the sake of killing. What could be more evil?
Logically, we can conclude that God is either not all powerful or he is not all knowing. If Christianity and Judaism had adopted the position that God was very powerful and smart, but not omnipotent and omniscient, maybe conundrums contained in the Bible would be resolved.
Food for thought: God could have created the first people so they were not so flawed. This is proof that God is clinically insane. He is a lunatic. Here is an example. God created people, they disappointed him, so he got mad and killed them. By analogy, I could build a table for my kitchen, and I could cut one of the legs one foot short. Then the table would be defective, and I could be mad that the table is defective and destroy it. That, of course, makes no sense. Why would I purposefully create something flawed if I will be angry that it has flaws? One may respond with, “We cannot understand the mind of God”; and I am forced to agree. But we also cannot understand the mind of the middle-aged man running through the mall naked except for pants down around his ankles and yelling out gibberish. We cannot understand his mind, but we can label him clinically insane; and we likewise can label God clinically insane. By our definition of clinically insane, God is certainly clinically insane. He is certainly a lunatic, and he is certainly an evil savage.
Some references for further research: