They did the same to the city of Ai as well. (Jos8)
Many of the dead would be called “innocent” today. War is not murder.
War is not murder per se, if it was entered for just reasons and is conducted justly. The requirements of justice involve (among ther things) avoiding attacks on civilians, which, if intentional, are murder.
Jihad, for instance, is murder. One of the big differences between the Judeo-Christian ethic and the way of jihad, is that people who are serious about the Judeo-Christian ethic do not intentionally attack civilians, and jihadis do.
God is the Lord of Life. He can take anyone's life justly: in fact, we all die. All of us. He can order the destruction of Jericho just as He Himself destroyed Sodom.
Absent His direct command, though, if we decide we have that kind of authority over life, ourselves, we are guilty of the gravest kind of sin. Not only murder, but blasphemy; because God forbids the shedding of innocent blood.