"But Joshua son of Nun and Caleb son of Jephunneh remained alive of those men" (Numbers 14:38). Why did Scripture need to say this? Has it not already said, "except Caleb son of Jephunneh and Joshua son of Nun" (verse 30)? Rather, what is the meaning of "lived"? That they merited their portion — that portion which they were fit to take in the land. Because they were among those who came out of Egypt, Joshua and Caleb inherited it.
Why Joshua and Caleb Lived and Inherited the Spies Portion
Midrash Aggadah, Numbers 14:38
ויהושע בן נון וכלב בן יפונה היו מן האנשים ההם. למה הוצרך הכתוב לומר כן, והלא כבר [נאמר] כי אם כלב בן יפונה ויהושע בן נון (פסוק ל'), אלא מהו חיו, שזכו בחלקם שאותו חלק שהיו רואיים ליטול בארץ, לפי שהיו מיוצאי מצרים יהושע וכלב ירשוהו: