According to the Laws of Hammurabi, “If there should be a woman innkeeper in whose house criminals congregate, and she does not seize those criminals and lead them off to the palace authorities, that woman innkeeper shall be put to death."1 This law would have reflected a common understanding in the ancient Near East and gives us a good idea of what was expected of people in the culture of that day. Rahab was thus expected to report criminals to the king.
By hiding the spies, Rahab thus sided with the Lord and Israel against her own people. She committed an act of treason.2
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.