I was wondering why it was that when Joshua ben Nun's spies snuck into Jericho, the first place they went to was a whorehouse. But Rahab the Hooker is listed in the rolls of the righteous in both Hebrews 11:31 and James 2:25.
Joshua 2:1-11 KJV
1) And Joshua the son of Nun sent out of Shittim two men to spy secretly, saying, Go view the land, even Jericho. And they went, and came into an harlot's house, named Rahab, and lodged there.
2) And it was told the king of Jericho, saying, Behold, there came men in hither to night of the children of Israel to search out the country.
3) And the king of Jericho sent unto Rahab, saying, Bring forth the men that are come to thee, which are entered into thine house: for they be come to search out all the country.
4) And the woman took the two men, and hid them, and said thus, There came men unto me, but I wist not whence they were:
5) And it came to pass about the time of shutting of the gate, when it was dark, that the men went out: whither the men went I wot not: pursue after them quickly; for ye shall overtake them.
6) But she had brought them up to the roof of the house, and hid them with the stalks of flax, which she had laid in order upon the roof.
7) And the men pursued after them the way to Jordan unto the fords: and as soon as they which pursued after them were gone out, they shut the gate.
8) And before they were laid down, she came up unto them upon the roof;
9) And she said unto the men, I know that the LORD hath given you the land, and that your terror is fallen upon us, and that all the inhabitants of the land faint because of you.
10) For we have heard how the LORD dried up the water of the Red sea for you, when ye came out of Egypt; and what ye did unto the two kings of the Amorites, that were on the other side Jordan, Sihon and Og, whom ye utterly destroyed.
11) And as soon as we had heard these things, our hearts did melt, neither did there remain any more courage in any man, because of you: for the LORD your God, he is God in heaven above, and in earth beneath.
The men may have gone to a prostitute's house because people were used to seeing strangers there. Its location on the wall made it easier to stay hidden.
Consider, she describes how they all knew about what God did in Egypt, and now they are all terrified. And consider, she had laid out flax stalks on the rooftop. This would mean she had started working flax, drying it, maybe to make thread for others, maybe weaving and sewing it herself. This could be showing us that she had left off the prostitution, and was doing honest work, hard work, poor people's work.
Maybe this is why the spies ended up at Rahab's house.
Much love!