Remember......when reading the Bible, CONTEXT is KING, NV!
From looking at the embedded contexts of what Rahab (the sinner) is reported to have said in the book of Joshua, I'm guessing that if the people of Jericho had initially surrendered to the Israelites in recognition of the presence and truth of God.........................they too would ultimately have been spared and would have been later incorporated into Israel.
As it is, the people of Jericho decided rather, like Pharoah, to unrepentently "hole-up" in their defenses and place their bets on their own false 'gods.'