I have heard many people criticize Rahab of being a liar and not really a hero of faith, because she lied to save the spies.
But one must also look at a few other heroes of faith who also lied and were also rewarded by God.
Abraham and Isaac who are father and son, both lied and said that their wives were actually their sisters in order to stay alive. Abraham lied to the Egyptians about his wife Sarah and then Isaac lied to the Philistines about his wife Rebecca. Both of them did this because they were afraid that the men in those areas would kill them and take their wives from them because they were so beautiful.
Instead of being punished by God for lying, Abraham was rewarded with herds of animals and riches by the Pharaoh for giving Sarah to him as his wife. The only person who was punished by God was the Pharaoh and his family with a plague after the Pharaoh found out that he had married and had been sleeping with another man's wife.
Isaac, Abraham's son also lied about his wife Rebecca being his sister in order to stay alive when God told him to settle in the land of Garar. Isaac was able to live a long life in Garar because of this lie until one day, King Abimelech saw them caressing one another and he then realized that they were actually husband and wife.
King Abimelech was upset with Isaac for lying to him, but after Isaac explained that God had told him to settle there and that he lied about Rebecca being his sister because he was afraid that they would kill him so that they could have her, he sensed the hand of the Lord upon Isaac and told the people not to harm him or his wife Rebecca.
And Instead of God punishing Isaac for this ie, the Lord blessed Isaac so abundantly that his crops reaped a hundred-fold and he became very wealthy.
So when you look at both of these cases, both of these heroes of faith were rewarded by God even though they lied because they were sent to do God's will, and in order to preserve their lives and the life of their wives, they lied about their wives true identity so that both they and their wives could complete God's work, and live with the hope of one day being reunited.
If you think about it, the devil similarly sought to kill Jesus so that he could take his wife, the church because she was "so beautiful." He did it also in the garden of eden when he tried to "take" Eve who is a representation of the Church, by tricking her in order to curse and kill mankind and eliminate any hope of being reunited with God.
But Jesus did something that the devil didn't expect because he couldn't see past his own pride and his own glory. Christ concealed the true identity of the New Israel, the New Church, his NEW bride, under the NEW COVENANT. And in the blindness of his own glory, he failed to see that he wasn't able to take God's wife the church by killing Jesus on the cross. In fact, he would be taking a wife that Christ already divorced in his death, paid for her sins with his blood, and allowed her to be born as a new Israel and a new wife under a new covenant. Just like Abraham and Isaac did before him, he concealed his wife's true identity in order to preserve his work, his resurrection and his wife's new birth as the New Testament church by allowing himself to be killed on her behalf for her sin and her fornication with "the devil." By doing that, he allowed for the sins of his wife, the church, to be atoned for with his blood, allowing her to come to Him, washed of her sins and be born again as a new church comprised of Jews and gentiles because of His sacrifice for her on the cross. In doing this, he defeated the sins of all members of this new church who believed in Him, defeating death and the devil himself.
So looking back at the stories of Abraham and Isaac, we see something similar. The devil probably said...I WON! THEY LIED! THEY DESERVE TO DIE UNDER THE OLD COVENANT! But again, being blinded by his own perceived glory, he couldn't see that they weren't lying, as only the devil can lie. They were PROTECTING THEIR WIVES WHO WERE SYMBOLS OF THE NEW CHURCH WHO WOULD BE REUNITED WITH THEIR HUSBANDS SO THAT GOD'S WORK and the GLORY OF THE LORD WOULD BE PROTECTED AND FOUND ONLY BY THOSE WHO HAD THE SPIRIT AND THE FAITH AND THE LOVE OF THE PROMISE WHO WAS JESUS CHRIST.
This is why there is such a difference between concealing a matter to protect others, which is the glory of God, and lying...which is the snare of the devil.
This is why the only person who was punished by God in the cases of Abraham and Isaac "concealing a matter" was the Pharaoh for sleeping with Abraham's wife. He didn't search out the matter with the spirit of the Lord before he acted with his flesh to determine that his laws of duress caused Abraham to conceal the identity of his wife.
This is because the Pharaoh's INTENT was always to rule over others and to RULE OVER GOD AND BE A GOD HIMSELF, so he didn't think before he acted. He just wanted to satisfy his own flesh and never even THOUGHT that his laws may have given him "permissible" things based on HIS interpretation of "the law" through such things as coercion and causing duress, such as by making people lie about their own wives being their sisters because they feared being killed...making permissible things..impermissible.
In this way, the Pharaoh is an antitype of the devil himself, where for example he TWISTED THE TRUTH and told Jesus to turn stones into bread because "it was written" and "permissible" but he wasn't doing this to praise God or to give honor to anyone but HIMSELF. HIS INTENT was to MOCK and RULE OVER GOD, which made that request...IMPERMISSIBLE TO GOD.
So when you look at Pharaoh, you see a man driven by his need to rule over others and rule over God and his use of the law is always twisted in some way at the outset in order to trick someone into doing something that seems permissible but is actually impermissible because of the addition of coercion or duress.
We are all sinners, and we sometimes "permit" and "allow" things based on our own interpretation of the law, but when it is revealed to us that coercion or duress was added in order to obtain righteousness in our own minds instead of God's mind, we should be cut to the quick, and instead of behaving like Pharaoh..we can look at what the Philistines did. They recognized that Isaac lied to them about his wife being his sister, but they realized that he only did it because of the duress and coercion that they added to their laws. If we recognize that people have lied to us only because of our own legalism or coercion or duress, we should realize that our own law was in opposition to God's love, and hopefully, that leads us to change.
Finally, there is one last case of lying where God rewarded the man who lied, and he called the man a hero of faith. That man was Isaac's son, Jacob. Jacob lied to Isaac who became blind in his old age and pretended to be Esau, who had sold his birthright to him, in order to receive his father's blessing, and Jacob actually received his father's blessing which could not be taken back.
God blessed Jacob even though he lied to receive this blessing from His father Isaac I believe because Esau did not take his birthright seriously and he was willing to actually SELL IT. Because of this, God allowed Jacob's lie to be permissible as it placed him in charge of his brother who took that duty so lightly and God gave that duty to someone who took it seriously. In this way, he preserved his own life and the lives of his innumerable offspring that would be blessed by the Lord.
All of these men AND WOMEN were considered heroes of Faith per Hebrews 11, and concealments of the truth were used to either reveal the error of coercive and legalistic law, to preserve their lives, or to preserve the lives of others so that they could fulfill God's purposes.
So, it seems to me, that if God selects a person to be used for his purposes, He will allow a lie to be used or the truth will be concealed, in order to protect God's people and protect God's work.
Even Judas' lie and betrayal led to the victory of Christ on the cross. Judas, of course, was not a hero of faith because his intent was not to save God but to expose him.
But God turned a lie that was intended for evil, and used it for God's Good and for HIS GLORY, and because Jesus stayed silent, WE are able to escape death like the spies that escaped death because of Rahab's lie, and WE are able to have the hope that we will be reunited with God like Sarah and Rebecca were reunited with Abraham and Isaac, and WE are able to take on the responsibility of the birthright that is given to us like it was given to Jacob and WE can receive the promise that is given to us because of our covenant with Jesus Christ.
In conclusion, in all of these cases, including the reason why Jesus was crucified, men and women of faith were accused of lying or sinning according to MAN'S FLAWED VERSION of God's law. That flawed version of the law didn't contain God's love, therefore what these heroes of faith stood accused of before men, was not considered sin before the Lord. In fact all of these men risked their lives by "Sinning" according to man in order to OBEY THE LORD.
This is why they are all heroes of the faith of JESUS CHRIST.