To some extent, politics unavoidably involves dilemmas about whether to insist on one's own principles (and risk being isolated) or to adapt to a more widely held opinion for the sake of working together.
Since the majority could be quite wrong in regard to particular issues, however, adapting to that majority opinion on those issues might, in a specific context, be an even bigger error than "keeping one's principles pure".