As you climb the ladder to the top, you will be under the leadership of someone who is, well, the leader. You have two choices, you can undermine what that leader is attempting to do by under cutting, publicly questioning, and doubting. Or you can help them to be as successful as they can be. I guess there is a third choice, you can leave that job, but you will continue that climb until you are in charge.
Then, you will remember how you were when it came to questioning the leader. Because now you are the leader, you will understand that the same thing is going on to you now. But if you remember what it was like as the underling, what it felt like to be treated inferior, it can help you not be just a good leader, but a great leader.
Once you have been the leader and you go back to being not in charge, you have a different perspective of leadership. Often you do not question and you can empathize with what the leader is going through, but because you have been the leader before, you still wonder if you could not do a better job. That's ok, it's normal, but you should never under cut the leader you are under.
Challenge: Help your boss be successful today. Maybe it's by doing your job, maybe it's by stopping negative talk, and maybe it's doing something extra, but do what you can.