Castle returned to Harvard in 1897. His early work focused on
embryology, but after the rediscovery of
Mendelian genetics in 1900, he turned to
mammalian genetics, especially that of the
guinea pig. That same year, he was elected to the
American Academy of Arts and Sciences. In 1903 Castle intervened in the debate on mathematical foundations of Mendelian genetics. He corrected some tentative work of
Udny Yule on breeding by deliberate selection and genetics. In so doing, he anticipated what has now become known as the
Hardy–Weinberg law. Formulated in the terms "as soon as selection is arrested the race remains stable at the degree of purity then attained", it appeared in his paper of November that year. At Harvard,
Charles W. Woodworth suggested to Castle that Drosophila might be used for genetical work. Castle was the first to use the fruit fly
Drosophila melanogaster, and it was his work that inspired
T.H. Morgan to use
Drosophila and the basis of Morgan's 1933
Nobel Prize. ==Bussey Institution==