Not quite Charles wanted to maintain Habsburg unity, though in the end he achieved the opposite.
In some was he was the last medieval universal emperor, not limited to the Holy Roman Empire, but to the theoretical whole Western Christianity.
He even failed to see, that his son would be a foreigner for the Prince-electors, who like his father would have too many obligations outside the Empire.
Ferdinand though basically raised as an Infante as a ruler never had any obligations outside the Empire, Hungary, Bohemia and Austria.
Up to this falling out, which IIRC was partly based on Charles' fear that separating the Habsburg domains would help the Reformation. The unravelling of Western Christian Unity was felt as threat and utter failure by Charles. He was a devout Catholic, who had urged the Papacy to some reforms of the Church; however like the Hohenstaufen before him, the Papacy was weary of being surrounded by such a powerful monarch (the wouldn't have liked a French* Milan and Naples either) and in some ways didn't mind political division in the Holy Roman Empire.
(*= controlled by the king of France)
Ferdinand had been very loyal to Charles and since he was King of the Romans, he would succeed Charles. However he had quite a large family (he did a better job at preserving the dynasty than Charles

) and he wouldn't allow, that his own house would lose some of their patrimony.
The debate was about whom would succeed Ferdinand, Philip II, son of Charles, or Maximilian II, son of Ferdinand. In the end the compromise, devised by their sister Mary of Austria, was that Ferdinand would support the bid of Philip and Charles would support Maximilian. In the end it didn't quite work out, nor matter, but having Philip marry Margaret could have been done as a symbolic reconciliation.
I don't buy, that Ferdinand would have allowed them to become nuns,
if** they could have served his dynasty. Both Charles and Ferdinand or any other contemporary monarch are quite unlikely to have acted in another way.
(**= that's an important condition)