Why did European royal houses intermarry?
Hans-Georg Lundahl Answered just now
Depending on century, but the main principle was:
- chosing a spouse on par in dignity (a royal could marry a total non-royal, but in that case the marriage was usually morganatic, at least in later centuries, that is, a juridical arrangement was made that the offspring could not inherit public functions like being in line to the throne);
- which one was often a question of diplomacy.
Next, the actual outcome was not very inbred as long as both Germany and Italy had very many different principalities, so that there were still very many royal or princely houses to chose from.
Holy Roman Empire was c. 400 states up to Napoleonic wars (1806) and Italy comprised several states as well up to Risorgimento (1870). The Gonzagas of Mantua are ancestry both to Marie Antoinette and Louis XVI. And let's not forget other small princely places which got centralised, the latter also descends from the Polish szlachta, in the Rzeczpospolica kingship was elective and in principle any person in the szlachta could be elected, and Louis XVI was Polish on two different lines, the paternal grandmother being daughter of Stanislas Leszczynski and the maternal grandfather being August III, son of the Frederick August II whom Charles XII replaced with Stanislas Leszczynski. But the Rzeczpospolica ended in 1795.
Lotharingia, Burgundy, Brittany were once more independent of France than later and the line from Mantua goes over Lotharingia.
With the ending of lots of independent states in 1795, 1806, 1870, as well as when Richelieu and Louis XIV centralised France, the situation changed and one would eventually have had inbreeding if it had continued for centuries. It didn't.