The writer speaks as if Joshua were a container and the spirit were a physical object that could be put into a container. Alternate translation: "Yahweh enabled Joshua ... to be very wise" (See: [[rc://en/ta/man/jit/figs-metaphor]])
The full meaning of this statement can be made clear. Alternate translation: "Moses had laid his hands on him to set Joshua apart so Joshua would serve Yahweh" (See: [[rc://en/ta/man/jit/figs-explicit]])