Certainly both were capable men, as evidenced by their foray into the promised land. However, in our worldly thinking, one can surmise that since Moses knew what was coming once they crossed the Jordan Riven, it would be a period that would require extraordinary skills as a military leader. He most definitely would have discussed with any potential candidate to succeed him what lay ahead and asked each of them how they would handle this. After thorough discussions, and fervent prayer,the decision was made. Or, God could simply have told Moses, without any of what I've just described, "I want Joshua." Either way, his selection as leader proved to be exactly what was needed at that particular time.
In case you might be wondering if Caleb got his due, look no further than "Greysons of Grimoire", a fantasy book online.