History seems to be repeating itself. In 2008, Democrats were elected by wide margins nationally after running on a platform emphasizing health care reform and fixing the economy. So once they were in power, they reformed health care and attempted to fix the economy, and then were punished heavily for doing so in 2010. The Republicans were put in charge of the House that year after running on a platform of fiscal responsibility. Once in power, they voted for the Ryan budget outline, which called for drastic decreases in federal spending on expensive items like Medicare. And now they're starting to get punished for it.
Did the GOP fail to learn the lessons of the Democrats? Was this avoidable? Well, that all depends on your view of a party's responsibilities.
In theory, the Democrats could have avoided some losses in 2010 by not doing anything on health reform. Sure, they would have still suffered due to weak economic growth and President Obama's relative unpopularity, but it might have been less of a slaughter if so many members in moderate districts hadn't voted for ACA (although it's hard to know the demoralizing effect on activists of failing to act on a longstanding priority). But would that have been the responsible thing to do? The party has been advocating for health reform for decades and suddenly found itself in control of the White House, the House, and 60% of the Senate. Even if they had known in advance about the drubbing they would take for it, would that have been a valid excuse for inaction?
And please don't suggest that they could have reformed health care in a less controversial way. Any effort to restructure a seventh of the economy is inherently controversial. The plan Obama ended up pushing was seen as the moderate, uncontroversial approach just a few years earlier only because no one was opposing it at the time. In a polarized environment, any effort made by one party to do something this big is going to encounter significant opposition.
Similarly, would it have been responsible for the Republicans to not push something like the Ryan plan this year? Republicans have been criticizing Medicare essentially since it was created, and any serious effort to deal with long term budget deficits -- something that Republicans promised to do when they ran in 2010 -- will have to address Medicare in some fashion. Now, they didn't have to do it in precisely this way, but it looks like they were being responsible. That is, they knew this plan would be unpopular but felt they had to push it.
I'd suggest that the alternative -- irresponsible parties that propose something in a campaign and then avoid acting on it in order to stay in power -- is far worse for representative democracy. Campaigns would become meaningless and politicians would be utterly unpredictable. The fact that we have parties that actually seek to deliver on campaign promises is something we should be celebrating.