Stories such as this one provide windows into the culture of the community that created them. Bible stories are not literal histories; each story is written with a religious purpose.
These stories reflect the nature of the community, of their belief in the direct interference of the supernatural into the natural world. History was therefore interpreted as actions taken by God(s), and these actions would be repeated should the community fail to learn from the (interpreted) history. The religious writers therefore taught that protection of the community and of the individual required full, complete and unquestioned obedience to God, and he spoke to them through the voices of these religious leaders who were writing these stories.
Do we see the same thing today? Are there religious organisations that say God will wreak his vengeance on people who disobey his voice, which he gives through them?
Let me give a modern example: a couple of years ago, Victoria experienced horrific bushfires, killing hundreds and destroying thousands of houses. One preacher said this was the result of God's vengeance against the State parliament enacting laws pertaining to abortion. The Bible stories need to be read similarly. (The fact that there were firebugs and that some fires started due to poor maintenance of power lines seemed to escape their logic. The main thing was to get people to align with their religion.)
Everything old is new again.
Doug