In the Marvel universe, the Avengers serve as the ultimate band of heroes, with the X-Men as a close second - due to the other also serving as the world's wildest boarding school. Being the ultimate band of heroes, however, also means that a lot of difficult situations are handed to them, which should go some way in explaining why such a team of good guys have done such terrible, terrible things.
With a planet and universe under constant threat, as well as a team roster continually trying to murder each other, it's only natural that some past actions have not been completely morally just.
There's something about seeing heroes in situations where they need - or feel the need - to do bad things that is just completely fascinating; some of the most interesting Avengers storylines come from situations where there is no right choice, only different consequences to deal with.
Between secret cults, zombie armies and outright genocide, it would be easy to think that the team stays in business by avenging their own past misdeeds...