figurative use (by 1843) is supposedly because a real black sheep had wool that could not be dyed and was thus worthless. But one black sheep in a flock was considered good luck by shepherds in Sussex, Somerset, Kent, Derbyshire. Baa Baa Black Sheep nursery rhyme's first known publication is in "Tommy Thumb's Pretty Song Book" (c.1744).
The least reputable member of a group; a disgrace. For example, Uncle Fritz was the black sheep of the family; we always thought he emigrated to Argentina to avoid jail. This metaphor is based on the idea that black sheep were less valuable than white ones because it was more difficult to dye their wool different colors. Also, in the 16th century, their color was considered the devil's mark. By the 18th century the term was widely used as it is today, for the odd member of a group.