From that first link :roll:
God orders killing
What about when God ordered Joshua and his people to kill every man, woman and child in Canaan?13 What crime could be so great that entire populations of cities were designated for destruction? God told Moses that the nations that the Hebrew were replacing were wicked.14 How "wicked" were these people? The text tells us that they were burning their own sons and daughters in sacrifices to their gods.15 So we see that these people were not really innocent. For these reasons (and others16), God ordered the destruction of the peoples whom the Israelites dispossessed.
What about the children and other "innocents"
Surely God could have spared the children! People tend to assume that children are innocent, even if their parents are doing bad things. The assumption is unfounded. For example, Palestinian Muslim children are officially taught in grammar school to hate their Jewish neighbors.17 They are so well indoctrinated that some of them give up their lives in suicide bombings as children.18 Corruption literally does breed corruption, which is why God did not want the Hebrews tainted by the other corrupt cultures of the Middle East.