Rahab was not mentioned favorably by the writers of the books of Hebrews and James because she told a lie at one point in her life.
She was commended for a lifetime of righteousness that followed a previous life of sin.