A Levite's concubine is raped to death by a Benjamite. In revenge the rest of Israel kills 25,000 Benjamite swordsmen. How can this be justified? Isn't this a clear violation of the law of Moses?
The book of Judges, in both 17:6 and 21:25 explains why society was so different at that time of Israel's history:
In those days there was no king in Israel, but every man did that which was right in his own eyes.
This book describes a period when people had lost the laws that Moses had delivered to them, and had set up their own society run by judges. It was not a nice time.
Remember, when considered as a book of a nation's history, the Bible is unique in that it not only records the victories and good times that other histories record, it also records the losses and bad times. Other nations' histories would omit or gloss over anything that didn't make them look like a great people with a great history. "History is written by the victors."
Israel is known as "the chosen people". They were chosen, not because they are better than everyone else, but because of God's promises to Abraham, Isaac, and Jacob:
For thou art an holy people unto the LORD thy God: the LORD thy God hath chosen thee to be a special people unto himself, above all people that are upon the face of the earth. The LORD did not set his love upon you, nor choose you, because ye were more in number than any people; for ye were the fewest of all people: But because the LORD loved you, and because he would keep the oath which he had sworn unto your fathers, hath the LORD brought you out with a mighty hand, and redeemed you out of the house of bondmen, from the hand of Pharaoh king of Egypt.
They were chosen to serve as an example to the rest of mankind. When the country as a whole followed God's rules, it prospered; when the country followed other rules, it floundered and was defeated by its enemies.
Deuteronomy 28, the blessings and curses chapter, explains this:
And it shall come to pass, if thou shalt hearken diligently unto the voice of the LORD thy God, to observe and to do all his commandments which I command thee this day, that the LORD thy God will set thee on high above all nations of the earth ...[long list of blessings]... But it shall come to pass, if thou wilt not hearken unto the voice of the LORD thy God, to observe to do all his commandments and his statutes which I command thee this day; that all these curses shall come upon thee, and overtake thee: ...[long list of curses]...
Most of the history in the Old Testament consists of Israel's ups and downs: good kings and prosperity, bad kings and defeat.