Here ‘credit’ means ‘acknowledgement of merit’ and nothing to do with money. The proverb means that we should acknowledge the good points of even those we dislike or disapprove of.
Mark you, I can’t stand the fellow, but I’ll give him credit for his business efficiency.