Do and observe whatever they tell you. (Matthew 23: 3)
Then Jesus said to the crowds and to his disciples, “The scribes and the Pharisees sit on Moses' seat, so do and observe whatever they tell you, but not the works they do. For they preach, but do not practice. They tie up heavy burdens, hard to bear, and lay them on people's shoulders, but they themselves are not willing to move them with their finger. They do all their deeds to be seen by others. For they make their phylacteries broad and their fringes long, and they love the place of honour at feasts and the best seats in the synagogues and greetings in the marketplaces and being called rabbi by others. But you are not to be called rabbi, for you have one teacher, and you are all brothers. And call no man your father on earth, for you have one Father, who is in heaven. Neither be called instructors, for you have one instructor, the Christ. The greatest among you shall be your servant. Whoever exalts himself will be humbled, and whoever humbles himself will be exalted. (Matthew 23: 1-12)
Jesus advises his disciples, and therefore us as well, not to hide behind the bad behaviour of some of our teachers. Since no amount of behavior can turn what is false into true and vice versa, we are responsible for our own actions. In order to do good, let us always listen to the true teachings and pray for our instructors, even when they behave in the opposite way.