Then Moses spoke to the Lord, saying, “[b]Let the Lord, the God of the spirits of all flesh, appoint a man over the congregation who will go out and come in before them, and will lead them out and bring them in, so that the congregation of the Lord will not be as sheep without a shepherd.” The Lord said to Moses, “Take Joshua the son of Nun, a man in whom is the Spirit, and lay your hand on him; and have him stand before Eleazar the priest and before the whole congregation, and give him a commission in their sight. – Numbers 27:15-19
How miserably qualified is that man for the work of God who is not guided and influenced by the Holy Ghost! God never chooses a man to carry out His designs but that one whom He Himself has qualified for the work.
Joshua was endowed by God with the requisite spiritual qualifications for the office. Moses howerer, was to lay his hands upon him, both in order to confer formal and public appointment, and also (compare Deuteronomy 34:9) to confirm and strengthen the spiritual gifts already bestowed. The previous reception of the inner grace did not dispense with that of the outward sign; compare the case of Cornelius Acts 10:44-48; and Paul‘s baptism after his miraculous conversion Acts 9:18. Barnes Notes
From a missiological perspective, Joshua needs the full presence of the divine breath for the task ahead of him (the conquest of Canaan), just as Moses also needed divine inspiration (for the exodus from Egypt and the wilderness sojourn). Arguably if Israel is to be a witness to the nations, as urged by both the Abrahamic and Sinaitic covenants, then the people of Israel need a leader who is filled with the divine wisdom.
Typical for the OT, by stating that the Holy Spirit is in Joshua, it infers He is not universally given.