Rahab’s house was probably either a tavern, an inn, or some combination of these. It was not a brothel, but a place where many travellers would have stayed, some of them also sleeping with prostitutes as they did so. As such, it would be a very logical place for the spies to visit, since it was a place where there were many strangers.1 This would have been the ideal place for them to find out information about the city.
1 And Joshua the son of Nun sent two men secretly from Shittim as spies, saying, “Go, view the land, especially Jericho.” And they went and came into the house of a prostitute whose name was Rahab and lodged there.