Now the sons of Israel arose, went up to Bethel, and inquired of God and said, "Who shall go up first for us to battle against the sons of Benjamin?" Then the Lord said, "Judah shall go up first."
Then the sons of Benjamin came out of Gibeah and felled to the ground on that day 22,000 men of Israel.
The sons of Israel went up and wept before the Lord until evening, and inquired of the Lord, saying, "Shall we again draw near for battle against the sons of my brother Benjamin?" And the Lord said, "Go up against him."
Then the sons of Israel came against the sons of Benjamin the second day.
Benjamin went out against them from Gibeah the second day and felled to the ground again 18,000 men of the sons of Israel; all these drew the sword.
Why did God allow the children of Israel to be defeated the first two times when it seems that they were justifed & had consulted the Lord?