The men pursued after them the way to the Jordan to the fords: and as soon as those who pursued after them were gone out, they shut the gate.
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.