The first issue will be identifying what a medieval setting even means. As a medievalist I have a very specific view on the time period, which perhaps colors my perceptions of this argument. What many would classify as medieval (Greyhawk, the Forgotten Realms, Dragonlance) I would tend closer towards calling pure fantasy. They have a semi-medieval base, but each of these settings makes liberal use of elements from the Renaissance as well as wholly contrived ones in such a way as to truly obscure anything about them that is particularly medieval.
The middle ages are generally divided into several periods by scholars who study them: the Early Middle Ages (what we formerly called the Dark Ages), the High Middle Ages, and the Late Middle Ages. I, personally, have striven for something akin to Early-High Middle Ages while most of the D&D settings (and indeed most fantasy books) are more firmly grounded at the very end of the medieval period and into the Renaissance. Characters from Waterdeep would be more at home in a Ren Faire than in an English village of 1206. Yes, that means most people wear tunics and hosen in Atva-Arunë, and that glass is relatively rare, and plate mail exists only in small pockets or amongst the high nobility due to the cost of dwarven and elvish manufacture.
Not that this is a bad thing, I just wanted to complicate your view of the medieval period a bit before we began. I've heard the complaint about medieval stasis repeatedly, and this was my first denial in a way: if there is an a-historicity to fantasy (something I'll concede for the space of this paragraph) then it is certainly not a medieval one, at least not in general.
But let us examine the contention that fantasy seems to be frozen at a time in history, a sort of permanent nostalgia. What supports this? Our ur-source for most modern fantasy is Tolkien (though we all know that Gygax was less keen to use Tolkiensien work as a starting point) and indeed Tolkien's Legendarium seems to have no history to it at all. Certainly there are events, but social and even technological structures always look the same. From the moment of the creation, nothing really changes until the defeat of Sauron.
A particular issue is the forward advancement of technology. A lot of people that are now getting into fantasy want it to be modern and vital, urban and forward-thinking, and find the lack of technology in the so-called medieval settings to be a sort of anchor that is dragging the genre backwards or keeping it tied to some romanticized historical past. Perhaps that's true for pulp fantasy, and it may even be true for well-written and otherwise thoughtful fantasy novels (though I could bring up several counterpoints) but this blog is generally about gaming and in specific AD&D, so it is to AD&D that I will hew.
My thesis here is that magic retards the forward advancement of science. The need for new technologies, at least as we understand them in the historical record, is simply not there. The kinds of inquisitive minds that would be experimenting to bring technology forward are turned instead to the study of the Art. The paradigms for "modern" advancements simply do not exist. That's not to say that technology should never move forward in a setting, or that trends shouldn't change. I do agree that a-historicity is a problem with a lot of fantasy, and I strive to combat it with different kinds of technological and aesthetic changes.
Let us address each point. The first is that the new technologies that advanced in Europe (particularly mechanization, transport, and gunpowder) are unnecessary in a fantasy setting. The Art can accomplish all of these things without the need for so-called scientific advancement (whether or not magic is science and what rules it follows is a whole other blog) greatly diminishes. Why worry about unstable compounds that might help you develop cannon when a war-mage can summon up a fireball for certain, and it won't ever backfire or detonate in your hands? Better equivalents of our technological advancements are available to mages at less risk to themselves.
Second, the kinds of people that would study science and engineering are more likely to become wizards and instead study the Art. Inquisitive minds that probe into things are the very criteria that most wizards look for in an apprentice. Admittedly, races such as dwarves don't have that issue because their smart folk don't become wizards, they become mine engineers (and this is an area in which I have allowed for variant technological advancement in my own games; hydraulic doors, advanced mechanisms, etc.)
Thirdly, the paradigms for the advancements we would expect don't exist. Science is contingent upon social expectation and, without getting too deep into Kuhn's Structure of Scientific Revolutions, most D&D settings and fantasy settings in general do not possess the paradigmatic requirements for technology to advance in the same direction that it did here on Earth. Indeed, it is a shallow idea of scientific advancement that demands a rigid linear pattern of motion from discovery to discovery exactly as we ourselves discovered them.
But should we not advance in some ways? Strong aesthetic differences between periods is one of those ways to make certain that history is kept in motion. Changes in state-structures, dominant ideologies, and religions is another method by which we can keep the wheels of history turning without resorting to the invention of gunpowder. We can even have parallel or unrelated advancements: as I stated above, the dwarves of Atva-Arunë have hydraulically balanced doors, complex gearworks, and expert architectural techniques.
Fantasy does not have to stand still, nor does it have to industrialize. There is, as always, a middle way.