It was told the king of Jericho, saying, Behold, there came men in here tonight of the children of Israel to search out the land.
The general morality of people throughout the world at the times in focus here was very imperfect, even on the part of the Israelites.  Rahab, like the Israelites, is commended in the Word of God, "not for her immorality (adultery and falsehood), but for her FAITH,"[17] and especially for her works in moving to support God's people.  See  Hebrews 11:31 and  James 2:25.