Q: Why does God sanction warfare in the Torah?
A: When the Jewish People first entered the Land of Israel, the Seven Nations who lived there were a reality in the world that had to be annihilated. The Torah says that if they will not be annihilated they will always be adversaries, thorns in the side of the Jewish People. The Jewish People will not be able to accomplish their purpose on earth in this situation. Throughout all of history, when a new phenomenon inherits an old one, it must uproot the old phenomenon so that the new phenomenon may take root.
When the Mashiach comes, true peace will reign in the world.