If I'm correct, Charles V ruled over Spain, Austria, Portugal and some Italian kingdoms (not sure of all of them but I know he had many kingdoms under his belt). Why didn't he just merged them to make one single country?
These were separate countries with separate administrations; often, they were managed by different methods of government and held different aristocratic hierarchies. In part, this meant that on a purely technical level such a merger as you describe would be unlikely at best; even imposing a unified tax system, for example, would have been incredibly controversial.
But more importantly, you're not taking into account the fact that individual politicians, statesmen, aristocrats, and so on in all nations were almost always opposed to any sort of merger, for many reasons. To give the example of the attempted creation of a "United Kingdom" in 1606-7 under James I, English nobles were paranoid that their influence would be much reduced under a merged system of government; the only kind of merger they were willing to condone was one which imposed English laws in their entirety upon Scotland, something which the Scots (and James I) were understandably reluctant to accept.
This is further compounded by the problems of national sentiment, instability, and so on; to take the example of Charles V that you give above, these were sovereign nations with extremely different traditions of rule (in Italy, those "kingdoms" had a long history of independent existence, Austria was steeped in the Holy Roman Empire and historically not close to Burgundy, Portugal and Spain had separate aristocratic traditions, just to skim the surface); to merge these countries would provide very little benefit, and provoke significant conflict. Even the merging of Castile and Aragon some years earlier had proven difficult, and both nations' aristocracies were by no means fully merged by Charles' reign; this in a situation where there was little in the way of linguistic or cultural barriers separating them.
It's really important that you don't think about things like mergers in "Crusader Kings" terms, which seems to be the general principle behind the question (if I may). Such large dynastic acquisitions rarely persisted beyond the reign of a monarch and his children (as can be seen throughout history - take William I and Normandy/England, for example); and these were nations with real, opinionated people, not building blocks to be combined at will.
It is instructive to examine what happens in Castile and Aragon when Charles V first arrived in Spain as their sovereign. There was reluctance to accept his rule and the council of Castile refused to recognize him. They instead pushed his insane mother Juana as ruler. Charles V then had to compromise to earn their acceptance.
In the next few years his largely Flemish retinue bought and bribed their way into important posts in the council. When Charles asked for a large sum to support his HRE election ambitions, the aristocrats were unhappy. When he left for coronation and appointed Adrian of Utrecht at regent, they rebelled, called the Revolt of the Communeros.
So even with a council that was already weakened and compromised through his Flemish allies, there was still such strong resistance and power within the "native" aristocrats that it culminated in the revolt.
After suppression of this revolt, key changes were made to weaken the authority of the council of Castile. But other entities (Aragon, Navarre) wasn't changed until much later. Part of this is simple indifference. Philip II called the council of Castile regularly because they provide significant revenue. By contrast, the council of Aragon was called only twice in his entire rule.
The council of Aragon was significantly reformed only much later, during the Bourbon rule of Spain. Both Castile and Aragon nobility were largely on the losing side of the war of Spanish Succession, so at the end of that war they saw their privileges reduced. On the other hand, Navarre was an early supporter of the winner so their system was left intact.
As far as the HRE is concerned, it is an elective system and you should read the FAQ in the wiki of this subreddit for more information.
To add to the other commenters: Charles V also did not merge his dominions because there was no precedent for it. Rulers had been inheriting multiple territories for centuries in Europe, but this was done through a legal inheritance system that did not include any provisions for permanently merging realms. If Charles V had attempted such a thing, it would've been a huge break with every legal tradition in Europe at the time, and thus would probably have led to large scale resistance both from his own realms (who of course would see no benefit for themselves in such a merger and would therefore have no reason to support it; in fact, such an action would potentially cause them to lose privileges or economic consequences, reasons to actively oppose a merger) and also from rival rulers in Europe, as it would increase Charles V's power and destabilize international relations as other rulers would feel themselves pressured to do the same thing to keep up with Charles V (and probably a lot of other related reasons that I can't come up with right now).
Not to mention the practical issues: the extent of Charles V's dominions was unheard of. Not for nothing he was called the 'universal monarch'. To attempt to merge such widespread and varied territories would've been extremely difficult with the 16th century technology and administrative institutions that Charles V had available to him. In fact, Charles V did actually make centralizing efforts in some of his territories (which, when it comes down to it, shares many aspects with the process of merging); specifically, he created overarching governmental institutions in the Netherlands, which were at that time a collection of technically independent counties, duchies and bishoprics with no collective institutions, and perhaps only the faintest of unifying sentiments (there was no concept of 'the Netherlands' as a state yet). But those efforts took a huge amount of effort and investment, and took decades to properly take shape, and at the end of his reign the Netherlands were still nowhere near a unified state.
Not that it is important or an answer to your question, but the union of Portugal to the Hapsburgs was after the reign of Charles V.