God sometimes ordered Hebrews to wipe out a city:herem. Was it immoral?

No, the adults had sinned mortally; children in it had not, but life is a moment to moment gift: God decided to stop giving it, using Hebrews as a means. Killing is wrong precisely because it is a violation of rights of God, the Lord of life.