What about other fantasy works that culturally influenced creation of D&D, like Lord of the Rings or Conan the Barbarian? Are those also anti-medieval?
I think a good argument for Conan being an American frontier series could be made. Especially Beyond the Black River which is about settlers fighting off natives.
The original Conan story is set in the 4th century, but the earliest stories date from the 12th century. He settled Brittany/Armorica whilst fighting for the usurper Emporer Magnus Maximus. His name seems to relate to Conan the Barbarian (cutting down the men and cutting out the tongues of women) and Meriadoc Brandybuck the hobbit who swore to the House of Rohan. The House of Rohan were the Breton rulers who claimed descent from Conan. A coincidence?
Lord of the Rings, at least, isn't even _trying_ to be medieval, is it? Like, the shire seems vaguely 18th/19th century England, Gondor seems suspiciously Roman/Byzantine... I don't think Tolkien was going for "this is [whatever period], only with dragons", and even if he was, that period certainly wasn't medieval.
Middle-earth arose from Tolkien's early attempts to reconstruct English / Anglo-Saxon mythology. Apart from the anachronistic Shire, the world largely feels early medieval.