You do not have to be perfect to urge ethical behavior. As ethicists have noted, all of us can be wounded healers. The argument that any advocacy of ethical behavior must be from a saint is a diversionary tactic. It is often wrapped in the cloak of nonjudgmentalism; the idea that no moral judgments must be made on the behavior of others.
That is amusing because, upon questioning, few people are completely reluctant to make judgments. The moral agnostic on one topic may turn into Savonarola on another.