Mary Tudor married her first cousin, Philip II. No children. The second Queen Mary, the daughter of James II, married her first cousin, William of Orange. No children.
Excessive inbreeding seems to be why the last Spanish Habsburg, Charles II, was an imbecile.
The ancient Egyptians practiced brother-sister marriage. There are cases of it among the Persians--King Darius II (423-404) married his half-sister Parysatis. They had 13 children of which only 5 lived; the older son Artaxerxes II became the next king but was challenged by his younger brother Cyrus--the story is told by Xenophon in his Anabasis (he was with the 10,000 Greek mercenaries recruited by Cyrus).
Who are we to judge? LIBs say all cultures are equal.
Mary's parents were as distantly related as most mediæval marriages - if her dad had been Henry the Plowman instead of Henry the King, noone would have remarked on it - yet Mary was the only child who survived.
Anne, sister of Mary II, didn't marry her cousin yet also failed to reproduce.
Their father Jmaes II unrealated to Ann Hyde, similar.
Their uncle Charlie II, seventh cousin once removed (can you say distant) to Catherine of Braganza, no children
Forward to the Hanovarians: George I married his first cousin, 2 children in first 5 years of marraige (before irreconcilable differences set in). His descendents were remarkably prolific, including Victoria, who also married her first cousin.
Conclusion: Fertile people have fertile children: Infertile people have infertile children.