The primary reason given in the biblical narrative for the Israelites conquering nations on their way to the edge of Canaan is that the kings of these nations would not allow Israel to pass through peacefully. According to the Book of Numbers (specifically Numbers 20-21), the Israelites requested passage through the lands of the Edomites, Moabites, and Ammonites, but their requests were denied, leading to conflict.
While the wickedness of the people living in those nations and the offense to Yahweh could also be factors noted in the broader context, the immediate cause for the conquests was often the refusal of those nations to allow Israel to traverse their territories peacefully.