A common American English saying. I don't know if other English speaking areas use it; probably not, most idiomatic expressions are regional. Due to the wording of the phrase, I'd be inclined to think it is American in origin, as it seems like something which would come out of a mostly Protestant society.
Meaning and interpretation:
This keeps you from being a hypocrite.
It means that you should do what you tell others to do. If you say to Joe Blow that he should keep his lawn a little better, don't neglect mowing for the next six months.
This is sort of an extension of the golden rule.