Joshua is a difficult book to read but looking at it from the "upper story" we see that God receives glory both through his judgment and grace.