It's hard for someone who doesn't understand the ways of God to truly understand what took place. First, a nation was offered surrender. If they refused they were annihilated. God pronounced judgement on the wicked, they paid the penalty for sin...death. You don't have to agree, but that was punishment according to Jewish Law. God never told them to go in and rape the women. The women were taken as wives for Jewish men. What you are doing is holding God accountable to what you think is right and wrong. If an evil nation/man is punished by death; was justice done? For example, that ginger that shot up the theatre, if he gets the death penalty; is it morally wrong since a life was taken? What constitutes "innocent"? Just some food for thought.

Of course free will is a loop hole, but it is not one reserved for Christianity alone. A siolder takes orders from his superior, if that siolder then abuses his power and commits some sort of war crime, is he not punished? If he was ordered to go capture an enemy strong hold and does so, but also tortures the inhabitants and prisoners; is that the fault of the superior because he gave him authority to use force? I think not. Everyone is responsible and held liable for their actions.