From the OED:
Blue Stocking lady: orig. one who frequented [Elizabeth] Montague's "Blue Stocking" assemblies; thence transferred sneeringly to any woman showing a taste for learning, a literary lady. (Much used by reviewers of the first quarter of the 19th c.; but now, from the general change of opinion on the education of women, nearly abandoned.)Like librarians, these intellectual women were considered dowdy. Apparently the term blue-stocking is in reference to that frumpiness. In the mid-1700s, one should be out and about in fashionable black silk stockings, rather than hose knit of blue worsted-weight wool.
For more on the term, check out World Wide Words' take on it.