Why then does the Torah give the others immortality by recording their names and the names of their fathers?
One answer is that the Torah is always realistic. It mentions both sinners and saints. Not that anyone really is a total saint and never sins. Judaism does not look for perfect people as its role models. It recognises that even the finest people sometimes do the wrong thing. Our task is to learn from mistakes as well as achievements.
When the ten spies sinned by maligning the land they taught us, and themselves, a precious lesson: you should not judge a task by its superficial easiness or difficulty. You should weigh up the whole situation and never underestimate the task or regard it as impossible.