This proverb is based on a theory that people who imitate you think that you are cool, so much so that they would very much like to be you, hence their imitation is an indirect form of flattery.

This proverb is usually intoned when a person complains about being copied. It is meant to soften the sting of being imitated, which is undeniably annoying. This tends to happen in a school environment; or between artists, writers, musicians, or in any circumstance when originality is held very high in importance.

I personally never thought the proverb did make much sense, as to be flattered by a person would require one to hold the flatterer in high esteem, and how can anyone esteem a copy-cat?