Joshua 2: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 know not. Pursue after them quickly; for you 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.
Now, according to a strict rendition of the letter of the law, Rahab was lying, hands down no doubt, but even though God does not approve of, nor sanctions lying in any way shape or form, the fact that Rahab was cooperating with God in the matter, should be enough to settle the issue in our minds. In addition to this, if God was in it, that should then be sufficient for the reader of the narrative, because what God does, or permits, in this or that situation has to be always understood in the context of His overarching Sovereignty.
Daniel 4:34 And at the end of the days I Nebuchadnezzar lifted up mine eyes unto heaven, and mine understanding returned unto me, and I blessed the Most-High, and I praised and honored him that lives forever, whose dominion is an everlasting dominion, and his kingdom is from generation to generation. 35 And all the inhabitants of the earth are reputed as nothing: and he doeth according to his will in the army of heaven, and among the inhabitants of the earth: and none can stay his hand, or say unto him, What doest thou?
In fact, Rahab goes on to be mentioned as one of the heroes of faith in the Bible, not for her ways and means, but rather for her cooperation with God and her upright motives. Again, if God was involved with it, then that settles it period, even if the letter of the law comes into question.
Hebrews 11: 31 By faith the harlot Rahab perished not with them that believed not, when she had received the spies with peace. 32 And what shall I more say? for the time would fail me to tell of Gideon, and of Barak, and of Samson, and of Jephtha; of David also, and Samuel, and of the prophets.
May The Lord add His blessing to the study of His word. God bless!