We know that Jesus Christ can never lie because it is not in his nature or character, therefore there is no way he could have lied to his brethren. Period. Any interpretation of that scripture that says otherwise is faulty. There is no story of Jesus not telling the truth. It is your interpretation which is insinuating that he lied. Scriptures are not purely interpreted by the letter in most cases because the letter kills. It is the spirit in the word that gives meaning to the letter. Jesus said, the words I speak to you, they are spirit and they are life.
As regards Rahab, King David and Abraham telling lies, we should know that, first, to be righteous does not equate to sinlessness. To be sinless, we must grow to the level of righteousness of Christ Jesus. The righteousness which he manifested unto us. We must grow in righteousness unto holiness. Our God says, be holy for I am holy. And, Jesus enjoins us to be perfect as our father which is in heaven. So, there is a level of righteousness required of us below which it is possible to sin.
In Ezekiel 18, we read, "when the righteous turns away from his righteousness and commits iniquity, and do according to all the abominations that the wicked man does, all his righteousness that he has done, shall not be mentioned, in his trespass that he has trespassed and in his sin, that he has sinned, in them shall he die." This confirms the statement above, that it is possible for a righteous man to sin. --- until he reaches a certain ' maturity" of righteousness
Also, the same Ezekiel 18 says, " when the wicked man turns away from his wickedness that he has committed and does that which is lawful and right, he shall save his soul because he considered and turned away from his wickedness. Therefore, I will judge you, everyone according to his ways, says the Lord God. Repent and turn yourselves from all your transgressions, so iniquity shall not be your ruin. Cast away from you all your transgressions whereby you have transgressed and make you a new heart and a new spirit"
Go and check the lives of the people you mentioned whether they did not repent of their sins and turned a new leaf and remained steadfast in God. God judges with his prescience of the future, so when he says one is righteous, no one can fault that. For he judges with perfect knowledge.
Secondly, we know that their dispensation is different from ours. in that, we are held to a higher moral standard than they were. For God has manifested himself unto us showing in person , an example of the new and living way he consecrated for mankind, that we have no more excuse. As Paul says in Act 17:30, the ignorance of the past, God winked at and now commands all men everywhere to repent. I have added this because I do not know what exactly you are insinuating in your post by mentioning them.