Morocco was subject to many external & internal pressures, such as the Portuguese & Spaniards applying pressure on the North African coast; the Ottoman Empire encroaching upon Moroccan lands & disunity/civil strife in Morocco. Furthermore, the Moroccans weren't involved in global trade like Castile/Spain and Portugal were, and it certainly didn't have the necessary means (manpower or technology) to colonize a place somewhere across the Atlantic.
Even then, it's not a simple question of who's got the technology to do it or not, but rather a matter of who's willing to put the money to work. It was only possible with the investments of Kings, private trade parties, Nobles etc.
On the flip-side, it would have been an incredible feat if Morocco was able to colonize the Americas and be the ones to conquer Tenochtitlan [Mexico City] instead of the Spaniards.