I think it was Richard Dawkins in The God Delusion (although I seem to have misplaced my copy) who tried to make the point, using the Book of Judges, that the Bible is not a good source for morality. Which, if you read the Book of Judges, is pretty clear. In other words, if you think the Bible is only or primarily a book of rules and morality, you will have trouble figuring out how the Book of Judges fits in. Despite the fact that Dawkins reads the Bible like a seventh-grader who’s had one world religions class, he is right on this point: the Bible is not a book of morality. There’s all sorts of morality in there, some good and some bad. There is also the additional point, which Dawkins–typically–fails to consider, that some parts of the Bible are meant to be prescriptive for moral action, while other parts are meant to be descriptive of how human morality, left to itself, always devolves. Those who think that atheists can act morally are correct, but for the wrong reason; they act morally out of the vestiges of a dying moralism rooted in a Christian past. We cannot say what would have happened had the West not been rooted in a Christian past (although, perhaps we could consider the Middle East as an opposite case study), but the fact is that a nearly universal Christianity of one sort or another has ruled the West since Constantine. Whether the political implications of that are good or bad, I think we can definitively say that the moral implications are almost universally good. Christians have killed and do kill other people, but the New Testament (through which Christians read the Old Testament) is fundamentally against murder, even murder committed in one’s heart. Christians have committed adultery and still do, but the New Testament is everywhere opposed to it. Christians have stolen, and still do, but the New Testament says you should give, rather than take. You get the picture.
But, back to Dawkins: his point is that religion is dangerous. Why? Because the Old Testament. There are ways to read the Old Testament, and Yahweh’s holy wars, in continuity with Jesus (and I read it that way), but the main point for Dawkins is that he assumes Christians (and, I’m guessing, Jews) read everything in every part of Scripture prescriptively, and therefore the Bible is a poor, even evil(!), guide to morality. One of his major examples, as I noted, is Judges. There are horrible things in the Book of Judges, but as I read it, people in Judges do horrible things not because they are following the lead of the sadistic god Dawkins sees in the OT, but because they are not. That is, in fact, the entire point of the Book of Judges.
God tells the people in Deuteronomy 31:
For when I have brought them into the land flowing with milk and honey, which I swore to give to their fathers, and they have eaten and are full and grown fat, they will turn to other gods and serve them, and despise me and break my covenant. And when many evils and troubles have come upon them, this song shall confront them as a witness (for it will live unforgotten in the mouths of their offspring). For I know that they are inclined to do even today, before I have brought them into the land that I swore to give. [20-21, ESV]
Joshua says many of the same things in Joshua 23-24.
But all of this is exactly what Israel does when we get to the Book of Judges: “And the people served [Yahweh] all the days of Joshua, and all the days of the elders who outlived Joshua, who had seen all the great work that [Yahweh] had done for Israel. And Joshua…died…And all that generation also were gathered to their fathers. And there arose another generation after them who did not know [Yahweh] or the work that he had done for Israel” (Judges 2:7-10, ESV). Everything that happens from now on is precisely because the people forgot God’s salvation. Because “not knowing” Yahweh doesn’t mean they don’t know His Name or that they’ve never heard of Him. No, the people in Judges are all very religious, very pious. That’s exactly the problem: they are running on the religious fumes of the Instruction (Torah) that Moses and Joshua had handed on to them. But they all get fat and comfortable in Canaan, and they do not teach their children the Faith of Israel.