The Rights of The (Upright) Scholars and Teachers
In The Name of Allaah, The Most Merciful, The Bestower of Mercy
They [i.e. (the upright) scholars and teachers] are the mediators between the Messenger [sallal-laahu-alayhi-wasallam] and his Ummah with regards to propagation of his religion and clarification of his sharee’ah. Had it not been for these ones, the people would have been like cattle. They are the ones who guide the Ummah in the fundamental and subsidiary affairs of their Religion. They return them to the rulings pertaining to the rights and dealings that are incumbent upon a person to fulfil, just as they return them to the affairs pertaining to affairs of worship. Through them, the Book and the Sunnah are established; truth is distinguished from falsehood, guidance is distinguished from misguidance, the lawful is distinguished from the unlawful, good is distinguished from evil, and [sound] rectification is distinguished from corruption. They are of varying ranks, in accordance with what they establish of knowledge, teaching and benefit- great or small. They have great rights [to be fulfilled] by the ummah and are possessors of a lofty status.
Therefore, the people must have love and respect for them. They must recognise their excellence and virtue, and thank them greatly. They are to supplicate for them in private and public, and seek nearness to Allaah by having love for them and praising them. They are to proclaim their excellence; guard the hearts [from harbouring evil against them] and [prevent] the tongues [from] insulting them, for this would tarnish their excellence. [End of quote] [Ref 1]
NB: Having respect for the scholars, loving them and making known their high status within the Ummah does not necessitate that their errors are followed, or that we prefer them above the truth when it is made clear that they have erred. However, there is certain way we are required to deal with the people of knowledge when they err as long as they are within the fold of Ahlus Sunnah and have not been declared innovators based on clear proof, or when they hold a different viewpoint but are still within the fold of Ahlus Sunnah. See following articles:
[Ref 1: Source: Noorul Basaa-ir Wal Albaab Fee Ahkaamil Ibaadaat Wal-Mu-aamalaat Wal Huqooq Wal Aadaab, page: 57-58′ by Imaam As-Sadi (rahimahullaah). Abridged and slightly paraphrased]