Well your premise is wrong, Castile and Aragon didn't coalesced into a unified Spanish kingdom, it didn't do that until the Spanish War of Succession (1705-1715).
Before that, the territories of the Spanish crown only had two common institutions: the Monarch and the Inquisition. But for the rest, each territory had their own institutions, with less or more degree of autonomy. Castile, for example, was mostly an autocratic kingdom, specially after the Civil War between Joanna and Isabel in the 1470s and the War of Communities in the 1520s, but still it had some territories with special privileges and laws like the Lordship of Biscay. Meanwhile Navarre, which had been conquered in the 1510s, nonetheless preserved its Charter and its political autonomy on laws, taxes, Cortes, and other matters of internal significance. The same happened in the Crown of Aragon, where each kingdom (Aragon, Catalonia and Valencia) kept its laws, customs, governments, Cortes, and even their own currency and army. Despite the desire from the Kings of Spain to unify the Peninsula under the system that ruled Castile, it never came to be until the Bourbons came to power. The Count-Duke of Olivares, minister of Philip IV, tried to do so to force the other kingdoms under the Monarchy to fund the wars of the Crown in Netherlands and France during the 80 Years War, but that resulted in the revolt of Catalonia and Portugal, the former failed while the latter successful.
It wasn't until Philip V won the Spanish War of Succession that all the privileges of the Realms of the Crown of Aragon were abolished. The Nueva Planta decrees abolished the charters and privileges of the Kingdoms of Aragon and Valencia and the Principality of Catalonia. That is when we can start talking about a unitary state, and even just so much, because Navarre and Biscay kept their charters, as well as some other smaller territories.