The Israelites waged war against the Canaanites because the Lord commanded them to. It was part of the Lord'd overall struggle against unrighteousness.
It is significant that when the Lord promised Canaan to Abraham, he did not give him an immediate right to it, but only a promise of future possession. In Abraham’s day the inhabitants of the land had a claim to it, but they would forfeit this right in the future as they increased in iniquity. Israel could then become the rightful claimant.