A lot of ink has been spilled about whether Israel has a rightful place in Palestine. I'm not going to address that (though I have opinions about it and support Israel's right to exist). But Israel's place has been controversial for thousands of years. When they came back to the Promised Land and wiped out most (though not all) of the inhabitants, people have reacted that they were simply giving in to their base nature which was warlike.
For much of that early campaign Israel could not fail, save for sin in the camp. But once there, God over and over again protected them from invaders.
One such incident I was just reading is in Isaiah 37 when Assyria came against Jerusalem. You should read the story for it is truly amazing how the Angel of the Lord slew 185,000 Assyrian soldiers in one night. But it again begs the question, why?
Judah was certainly not modeling godly behavior. They had fallen into idolatry and were really not serving God very well at all. So why spare them? Well, first of all, it was the land that God was saving, it was the people. And why save the people? For one reason, the Messiah.
Notice in Isaiah 37:35 "I will defend this city and rescue it, because of Me and because of My servant David."
God was entering into enemy territory to bring in the Savior. He needed a force to go first and create a birthplace for the Rescuer. That's why He defended His people and made a place for them to live. It wasn't that they were so great, it was that God had a great plan to save them and everyone else who would trust in the Messiah.
In the end, it really is all about Jesus.