18 And the children of Israel arose, and went up to the house of God, and asked counsel of God, and said, Which of us shall go up first to the battle against the children of Benjamin? And the LORD said, Judah shall go up first.
26 Then all the children of Israel, and all the people, went up, and came unto the house of God, and wept, and sat there before the LORD, and fasted that day until even, and offered burnt offerings and peace offerings before the LORD.
28 ... And the LORD said, Go up; for to morrow I will deliver them into thine hand.
I believe the matter was handled poorly from the begining. They hadn't asked Jehovah how to handle it or to go up with them or to give them victory. Their questions to Him shown they were being self reliant instead of FULLY relying on Jehovah to instruct them and GIVE them the battle. Joshua made the same error in fighting with Ai...It's a good idea for us to check with our creator first in lifes matters, just to be sure we're on the same page with Him and to give Him the honor and respect do Him as God Almighty So to answer your question 'why' IMO He let them learn a HARD lesson.