I disagree with that statement, in Portugal there has generally been a collective distrust of Spain and before that Castille. There is a saying in Portuguese that goes "de Espanha nem bons ventos nem bons casamentos" (from Spain neither good winds nor good marriages come). The last part aludes to the marriages with the Castillian and later Spanish royals that had threatened to wipe Portugal off the map.
«
De ponent, ni vent ni gent» - That is a Valencian proverb which means "From the West, no wind nor people". Valencia is today a clear Spanish city and despite the late revival of Valencian language everybody there feel Spanish. What does that mean? Easy, many things can change in 500 years. The proverb of above is actually "only" 300 years old.
By 1580 Portugal had over four centuries as an independent kingdom, with the same boundaries since 1250. The country was religiously and ethnically homogenous and was perhaps the earliest unified nation state in Europe. The nobility was not powerful like in other European countries and this did contribute to a sense of nationality coming about. The nobles were the ones that revolted in 1640 but many of their slogans were distinctively nationalistic.
Almost all of above can be said about Catalonia and Naples, except for the nobles part (I will return later to this).
Portugal could have remained Spanish had Philip IV not been so intent on centralising power in Madrid. Up until his reign, Portugal was treated as a separate kingdom and had a degree of autonomy. However, he was not the wisest of sovereigns making a decision like that one at a time when Spain was growing weaker and was being attacked by the Netherlands, France and England.
So what would do him? Relay more and more on a impoverished and depopulated Castile by the wars while the other Spanish Kingdoms almost don't give a coin to the treasure nor a man to the army? What he (better said, his prime minister Olivares) did was what was needed to be done. It caused troubles everywhere, in Portugal, in Andalusia, in Catalonia, in Naples... and only Portugal successfully broke out. Give the Tercios an early victory and Portugal would be controlled like any of the other kingdoms inside the Spanish Monarchy.
The Portuguese language is also quite distinct from Castillian especially the pronunciation. Perhaps if the Spanish had been as radical as Napoleon they could have wiped out most traces of a regional identity. Remember that before him France had many different dialects, and today more Bretons speak French than Breton.
Any Castilian-speaker can understand any Portuguese speaker and vice versa. This cannot be said about a Castilian speaker and a Catalan one, needless to say a Basque. Plus, there is the case of the Galicians, who speak almost the same language as the Portuguese, and they had not rebelled ever against the Spanish government. Nobody needs a Napoleon or a Franco to hold countries who had nothing in common in the 1640s. Remember Austria-Hungary? It existed till 1919. And it was an ethnic chaos compared to the closely relate peoples of the Iberian Peninsula.
In the end, the things that make the Portuguese case something really different than any other Spanish kingdom of the time and can explain why it broke out are these:
- It had its own colonial empire, making it unique. The constant English and Dutch attacks against the Portuguese holdings in Africa and Asia while the Spanish colonial authorities prefered to invest their resources in America gave the idea that Portugal was abandoned, and that it would return to the better situation of the past after achieving independence. It didn't, but that is other story.
- The Portuguese union was very late compared to the one of other Iberian kingdoms.
- As you said before, the nobles, who were the ones with local armies and weapons, chose to support independence. Other rebellions like Catalonia and Naples were more peasant and civilian uprisings.
- While Catalonia and Naples had high economic and strategic value in Europe and the Mediterranean, and especially in the face of French expansion, Portugal was secondary. So it's not so rare that Olivares chose to move the Tercios to Catalonia instead to Portugal, and when Portugal received attention it was too late. But, even in the worst case, the independence of Portugal, and even its colonial empire, it wasn't a catastrophic lose. Oh, yeah, the Iberian Union was broken, but wasn't it as well 100 years earlier? The port of Lisbon was lost, but there were others more profitable like Seville and Cádiz. The Açores and Madeira were lost, but there were the Canaries to secure the route to America. Brazil and the Afro-Asian trading posts were lost, but there were the other American colonies that were 100 times more valuable. Macao was lost, but you don't need it to trade with China when you own the Philippines. Portugal was less valuable than the resources neccessary to retake it, especially now that the Portugese weren't so "docile", so it's not surprising that in the end the Madrid bureaucrats accepted the independence of Portugal and let it to retain all their colonies except one: Ceuta, which was the guardian of the Gibraltar Straits.