There was a very good reason for slaughtering the whole community. Why do you question God's motivations?
I question the morality of someone who would not question the motivation for slaughtering a whole community.
The purpose of israel was not supposed to be bringing a message of peace and love. That is you putting your own goals as God's goals. The purpose of israel was to let the world know who the true god was. It was to put a glaring contrast between Jehovah and baal or ra or whoever they had as god's back then.
If there is objective morality , rather than situational morality, the slaughter of people would be just as evil then as it is now. Under objective morality, something is either right or it is wrong.
What I was taught about the stories about the slaughter is that the Torah used exaggeration and such. Back in the day, the Israel's were a relatively small group that was trying to 'fight for survival', and stories like these were something like a beta fish puffing itself up to make it look bigger.