I would agree with the criticisms and / or negative statements about the Iberian war effort in North Africa, if the extent or objective of both the current and future Iberian campaign in Africa and its occupation were all of Maghreb, but they are not.
When affirmations are made about both the resources (material and human) and (minimizing them explicitly or implicitly) the potential or real capabilities of a united Iberian kingdom ...
First, we must take into account and remember both the naval and military efforts deployed by Portugal in relation to its economy and demographic potential in America, Africa (East) and Asia. As well as those made by Spain (mainly by Castile) simultaneously in America and in the service of Habsburg dynastic politics in Europe for more than two centuries.
Secondly, given the above, can't be ignored the potentials and / or eventuals, economic and logistic capabilities of a united Iberian Kingdom (even if its constituent kingdoms retain their legislative / fiscal autonomy in their courts).
As well as its industry / tradition of shipbuilding, to build and improve its Navy of war.
As well as, for to recruit and deploy the famous Spanish Tercios (but, despite their name, they were not all Spaniards nor even, were all recruited in the Peninsula, the soldiers in the Spanish Tercios).
The Tercios were characterized by their mobility on the battlefield (infrequent for the epoch) and for their capacity to adapt to any situation. That, together with their efficiency and operative quality (for these epoch's European military standards) allowed them for gaining both a fame and respect, (by their enemies) from which them proved to be worthy, for more than 150 years, across the battlefields of the Europa.
In any case, the area of conflict is only in the north of Morocco and some key cities and the effective control is even smaller (ITTL) and in the case of Morocco is basically only in the north Mediterranean coast and part of its hinterland and part of the Atlantic coast with also part of its hinterland (although it seems, according to the TL narrative, doesn't extend neither very south by lack of interest nor towards the Moroccan countryside (at least by the medium term).
But it should also be taken into account, when analyzing the hypothetically possible Iberian expansion that once have been obtaining their objectives (conquer and occupy the traditional areas with greater political-economic interest and / or strategies) for the Iberian monarchy.
About this there would be no greater interest (in the medium term, at least) in investing or prioritizing the necessary resources for a continuous or permanent campaign both in the Moroccan interior or to extend the effective control beyond the respective hinterlands of the conquered/taken cities.
Except, I guess in Tunisia, where, because of their importance the strategic needs are likely, making that the effective control area would be more widespread than in the rest of the western (African) Mediterranean.
Where Iberian control would not extend (probably) far beyond the 'hinterland' (approximately and according to an interpretation of the geographic term, not very strict, of course).
Leaving the 'rest', under the control of tribesmen chieftain or petty kingdom which in exchange for their vassalage would they receive both military protection and (personal) funding as part of the Iberian political support for the safe continuation of their respective rule against possible threats.
Also in North Africa at the time, there were no political unity and no prospect, at least in my opinion, of overcoming the political stage of tribal hegemony or beyond its common identity as Muslims (predominantly Sunnis), was not very homogeneous, showing a great variety of manifestations according to the ethnic / tribal group that would control / conquer that region ( in whole or in part).
Nor did there exist (in my opinion, by it's modern meaning) a sense of belonging or 'national' identity beyond their respective ethnic groups and / or of the aforementioned tribal structures and their opposition /difference with respect to, in particular, the great Arabized cities of the North African coast.
As for the political aspect, after the destruction of the Moroccan 'sultanate', which was the only (and historically) supra-tribal political organization native to the Maghreb able to organize a resistance and / or a potential threat capable of rejecting or dissuading the Intervention and control in at least Morocco.
Regarding the Iberian monarchy's ability to govern a Muslim population, without alienating it or pushing it to flee the cities and / or a desperate resistance ... the, in many cases, decades of domination in OTL on the Islamic cities in Africa and previously for centuries, in the peninsula, could testify, that the Iberian Kingdoms possessed both the experience and the ability to make compromises and for to govern pragmatically their muslim subjects.
Of course, as any State policy...the above would ultimately depend on the way in which it is applied to the 'terrain' and its decision makers abilities as well as the capacity for resistance and its institutional / dynastic management of the ever present, religious and eventually social pressures against these kind of tolerance and/or pragmatic politics.
But it should also be noted that with a strong and prestigious monarchy by ITTL, the victories obtained and its ability to redirect to America and /or Asia... For the King to face the possible social pressure and religious zeal... allowing to diminish the possible importance / seriousness of the above mentioned pressures and their possible political consequences.