It all depends on the situation . If we see that the situation requires us to speak up and by not speaking up, a wrong will not be corrected, then it is imperative that we speak up.
However, there are situations, where it is better that we keep quiet. In a certain situation, where two people are fiercely arguing about an issue which is actually trivial and it's all about winning an argument and nothing else, and one of them just wants somebody to support their stand against the other, then it is wiser not to add fuel to fire.
Quite a lot of times it is about our 'ego'. We prefer not to speak up so that we won't 'lose face' . Or we are afraid that we 'll be confronted, afterwards, by the party we spoke up against and given a stinging rebuke by them. The 'moral' of it all is to check our motivation.