"The Marching Morons" by Cyril Kornbluth is a science-fiction story from 1965 that discusses similar themes as does 1954's "Search the Sky" novel by that same author and Frederik Pohl.
In Buck v. Bell, the Supreme Court held that a Virginia statute compelling the sterilization of the intellectually disabled after a full hearing subject to appellate review did not violate the Due Process clause of the 14th Amendment. Justice Holmes, writing for the majority, affirmed the value of a law like Virginia's in order to prevent the nation from "being swamped with incompetence . . . [t]hree generations of imbeciles are enough." I'm not sure how popular the eugenics movement was among the American upper class at the time, but if this case stands for anything, it shows that at least the U.S. Supreme Court valued the states' interest in protecting its population from "imbeciles" spreading their genes.
Source: Buck v. Bell, 274 U.S. 200 (1927).
This isn't a top-level comment in terms of sourcing, I just want to suggest a clarification to the question posed and the background from the OP.
Idiocracy is centrally positing a problem with social structures favoring a part of the gene pool that is intellectually inferior.
Wealthy/aristocratic/upperclass people fearing they are outnumbered is something that rests on a somewhat different basis, that their rank/prestige/wealth is threatened by burgeoning underclasses. They aren't depending on superiority of talent, but on social position or wealth for their status, and it doesn't inherently concern itself with the total health of society due to genetic degradation (though it may be that some upperclass people think of themselves as more talented/able than the masses).
So it might be interesting to limit replies to earlier concerns about something similar to the gradual degradation of talent, intelligence, or health based on the "wrong" people breeding.
This question has been removed because it's a "throughout history" question, which are not appropriate for this subreddit. If you have a specific question about a historical event or period or person, please feel free to re-compose your question and submit it again. Alternatively, you may PM /u/caffarelli to have your question considered for an upcoming Tuesday Trivia thread.