By extension of the first meaning, it would mean typically if not necessarily a young man. And the second meaning is not the degree itself, which would be called a bachelor's degree, but its holder. In the middle ages, when the first western universities were founded, the students would have been young, male, and often poor or in holy orders, thus unable to support a wife or household, and so they were usually bachelors.
An "eligible bachelor" is (I think) a much later notion, maybe peaking in the 19th century. It means a young man who is considered a particularly attractive candidate for marriage by a young woman, and even more so by her family, in terms of his social stature, wealth, career prospects and whatever the Victorians would have called sexiness.