It is a proverb that warns against associating with people who are considered to be lowlife or unsavory. This can include people who are associated with animals such as dogs, which historically have been seen as dirty and untrustworthy.