The book of Judges starts badly and gets worse. The end gets completely censored, never read in church, even the Sunday School stories get their naughty bits covered up!
The book ends with a slogan in 21:25 “In those days Israel had no king; everyone did as they saw fit.” Which neatly prepares for the books of Samuel except by the time we reach the end of 2 Kings (even if we are slow learners) we realise that kings are not much better.
And that’s how Scripture develops in the Hebrew Bible, in the Christian Old Testament Ruth stands between a beautifully told and thoroughly nice story between two ugly collections of humans behaving badly. A reminder of God’s redemption of human wrong, and of the part we humans can play in revealing that redemption.