“You, therefore, who teach another, do you not teach yourself? You who preach that one shall not steal, do you steal?” (Rom. 2:21).
Teaching oneself is the most important element to a Christian’s growth with respect to salvation. Whether as a mere believer or a preacher of the Word, the moment we find something wise, benefiting and befitting from the Word we ought to first fill it to ourselves. Then the fruit of it will supply us the exact sense of teaching it to others. For example, if we lie and tell others not to do so, we speak without knowing the effect and the deeper sense of speaking the truth. Then we are restricted in projecting the consequences of speaking the truth and its glorious rewards.
The verse in particular does not call upon the righteous and the just. It is for those who pretend righteousness and justice that simply take advantage of any situation or position. When men and women of the Christian strata take up teaching the Word for their benefits, they are not followers of Christ. They are pretentious. They teach others only for their own glory, i.e. for that which they are able to articulate by their own knowledge. Since it is of their knowledge, they do not believe it is necessary that it applies to them; it is only for those whom they address. Their knowledge of the Word most of the times is intellectual, but is false and the things they speak right are borrowed from others. Therefore, they do not practice what they teach.
In essence Paul is speaking of the hypocrites who wish to live lives wantonly. These make their speech useless by their actions. As such the entire congregation or the people they influence never come to the wealth of knowledge in Christ for a place in eternity.