and it happened about the time of the shutting of the gate, when it was dark, that the men went out; where the men went I don't know: pursue after them quickly; for you will overtake them.
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.