Seeing "the Bible" as a single work to be read literally is a fallacy, a fallacy that dilutes comprehension of the texts.
It is an anthology of many works, written in different eras, using different styles for different audiences and purposes, in the cultural context of the time each book was written. It has literal histories, it has historical legends, it has theological and philosphical studies, it has morality tales.
Some is literal, some is metaphoric, some is philospohical. "All scripture is instructive," but only when read with the literary and cultural context in mind.