Joshua the son of Nun sent out of Shittim two men as spies secretly, saying, Go, view the land, and Jericho. They went and came into the house of a prostitute whose name was Rahab, and lay there.
"Sending out men for reconnaissance was a widespread phenomenon in the east. Moreover, a prostitute’s or innkeeper’s house was the accustomed place for meeting with spies, conspirators, and the like. Thus, for example, we read in Hammurabi’s Code: ’If scoundrels plot together [in conspiratorial relationships] in an innkeeper’s house, and she does not seize them and bring them to the palace, that innkeeper shall be put to death’ (law § 109). In a Mari letter we read about two men who sow fear and panic and cause rebellion in an army. Also, the pattern of a three-day stay in an area when pursuing escapees has support in ancient eastern sources; for example the instructions to the Hittite tower commanders specify that if an enemy invades a place he must be pursued for three days. In the same collection of instructions we find that it is forbidden to build an inn (arzana) in which prostitutes live near the fortress wall, apparently because of the kind of danger described in Joshua 2." [Note: Moshe Weinfeld, The Promise of the Land: The Inheritance of the Land of Canaan by the Israelites, pp. 141-43.] 