I would say it is a matter of execution. On a visceral, emotional level, I am on the edge of my seat when I first see Days of Future Past. Going in I know that the future will be prevented and (likely) X3 will be as well. But in the moment, I feel like the fate of the world is over as Magneto destroys the White House's South Lawn. And when Mystique turns the gun on Trask, and Xavier reaches out to her, it feels like an authentic character moment that you want to see her commence.
With The Avengers it was just fun. All the heroes were making quips and having fun for most of it. "I'm bringing the party to you"/"That doesn't look like a party," "Puny god," whatever lame line they give Hawkeye when he is bantering with Stark about how the aliens can't bank, and the rapport between Cap and Black Widow when she "catches a ride."
It felt more like a party complete with Hulk sucker punching Thor. The only time Whedon really raises the stakes is when Iron Man calls Pepper and she doesn't pick up. Otherwise, it is fun, but not very suspenseful.
I imagine Whedon is aware of this and it was a clear choice to make the movie as joyful as possible. I suspect he will try to raise the stakes, at least tonally, for the next one.
In Days of Future Past, the execution was so good that you forget it is a foregone conclusion and are holding your breath. That is great storytelling right there. AT least it is in my opinion.