The presupposed equation is that actions will have the desired effects. It's also possible for one to sacrifice their life/joy and do nothing but evil unintentionally. In fact, history is full of examples of intelligent men who dedicated their lives to an idea only for it to become a sick parody of itself. As a quick example, Marx started more capitalistic revolutions than he did communist, and spent most of his life trying to stop Marxists. As such, the idea that one could or would sacrifice themselves for 'the greater good' is a bad notion as it would always be superior to maintain ones ability to affect the world in even minor ways than to lose it all.
However, there are situations and scenarios in which one may have absolutely no other choice. Where they have been rendered powerless to affect or stop something, and the only chance to even disrupt it is something so radical that it could require their own death. In which case it is a choice of necessity, not to be lauded by any means, but to at the very least be respected in the same vein as 'fighting to the last' or 'the band played on' should be.