I think it was the Lucas Critique, not stagflation

A common thing you hear is that stagflation was what lead to the decline of Keynesianism in the 1970s. I think a lot of Keynesians are puzzled by this because although policymakers in the 50s and 60s might have counted on a stable Phillips Curve it doesn't seem like anything at the heart of Keynesian theory.

You can also think about one of the earliest efforts to think more critically about the Phillips Curve: the Phelps volume in 1970. If you read the introduction to this book it sounds like New Keynesians' stuff you might read two decades later. It's explicit goal was to make a connection between Keynesian macro and necolassical micro, both of which were considered to be the right approach forward. So there was nothing anti-Keynesian in spirit about Phelps's expectations augmentation of the Phillips Curve (perhaps Friedman thought of his work in those terms). This sort of "working in the Keynesian tradition" attitude is still apparent on Phelps's website today even though he's come out with some goofy critiques of Keynesians during the crisis. So what is the classic answer to stagflation? Expectations augmentation of the Phillips Curve, right? We talk like that was a non-Keynesian thing, but I don't think that's the right way to look at it (although I'm sure lot's of people at the time talked like that as well... I doubt Keynesians felt very shocked by it all, though).

I think the Lucas Critique was much more significant, not so much because it impressed upon Keynesians the need for microfoundations (as I said, that was already being pursued by guys like Phelps who framed their work as a Keynesian effort), but especially because it offered a structural model that was distinctly non-Keynesian that predicted the same phenomena. Suddenly non-Keynesian stories became viable. In addition, the big macroeconomic models people were running couldn't just cite the fledgling Phelpsian microfoundations literature with a Keynesian story and then go on modeling their reduced forms - people had to actually worry about whether a completely different microfoundations was the real story and that required testing and running more structural models.

I am with Noah Smith in thinking that the Lucas Critique was very good for economics and that it exposed a severe blindspot of Keynesian economics. I think the response has been well handled, and we've done a lot of work testing alternative microfoundations. Not only that, but the critique is still in the background - it's something we always have to worry about - which is pushing important work in things like agent-based modeling.

In the end, I think this had a lot more to do with the decline of Keynesianism than stagflation did.