If there was a time of keeping bloodlines pure, when did that start? Did the concepts ever trickle down to other social classes and cause gene pool problems there as well?
There was little about keeping the bloodline pure - it was about not marrying below your station. And as you say, the limited amount of royalty meant that there were very few to choose from.
European royalty generally considered Asian and African royalty to be savages and not real, proper royalty. Self-made royalty such as the likes of Emperor Napoleon of France or Emperor Augustin of Mexico was frowned upon. This restricted the available marriage pool to the royal houses of Europe.
To further complicate this issue, for a long time the three main christian churches frowned strongly on their royals converted to become queens or kings of other countries. Orthodox princesses would not convert to become queens in protestant or catholic countres and the other way around. While the edict of tolerance easied relations between protestants and catholics and it became more common for catholics and protestants started to convert, orthodox royalty still would very rarely convert.
Marrying commoners happened very infrequently, as it meant a loss of prestige that could cause nobles or commoners to revolt. King Erik XIV of Sweden married the commoner Karin MÃ¥nsdotter, making it much easier for his brother King Johan III to seize the throne.
For a long time, the large amount of princely houses in Germany, both catholic and protestant supplied wives and husbands of royals all over Europe.