Is it not immoral and unjust to wage war for purely economic reasons. (Since it is natural for people to defend their homes, family and nation, deaths will certainly occur.) Also:
A) There is no reason to suspect that these people are especialy depraved as were the 7 nations.
B) There are things that theoreticaly are permitted under Halacha, but in practice are forbidden because it would seem that Jewish law is inferior or less moral than nonjewish law.( The nonjews have the concept of "Just War", that wars should only be fought for certain just reasons.
Sh. Levenson , Chicago USA
(a) The MARGOLIYOS HA'YAM (#22,23) suggests, in answer to your question, that David's advice should be read, "make war *against* the Gedud." The Gedud refers to the marauding Amaleki tribes who were constantly disturbing the economy by raiding the local fields and otherwise threatening the nation (Shmuel I 30:8 "ha'Gedud ha'Zeh"). This, he says, is why (according to Rashi here and in Berachos) he only asked Sanhedrin to pray for him, and not to *permit* the war (since it is certainly permitted to war against Amalek.
Sharp though it is, this interpretation is somewhat forced in the words "Pishtu Yedeichem...," nor does it fit into the Gemara about "Ein ha'Bor Mismalei me'Chulyaso." All the Rishonim explain that Gemara to mean that the Jewish People were looking for wealth *outside* of the nation by overcoming a foreign nation. (According to the Margoliyos ha'Yam, it seems that David ha'Melech answered that it is not necessary to look for "dirt to fill the pit" as long as Amalek can be stopped from marauding. However, it would seem from the complaint of the people that even if they were not *losing produce* to Amalek, there still would not be enough to feed the people.)
(b) It is perhaps more likely that the war David suggested that they start was the one in which he conquered Aram Naharayim and Aram Tzovah (or Surya), the nations that were considered to be "Kibush Yachid" of King David (Gitin 8a and elsewhere -- the description of our Gemara fits according to both Rashi and Tosfos' explanation of Kibush Yachid there, I believe). I found strong support for this suggestion in Rashi Sotah 44b DH u'Milchemes Beis David.
As to your question, we may assume that the people of those areas were antagonistic to the Jews, and periodically waged war against the northern territories of Israel. Although David would not have instigated a war because of this (but rather would send troops to defend the nation each time a war was waged), since the people needed more territory, he waged a war and conquered the entire area.