Troubling eugenicist ideas appeared alongside calls for liberty and equality in the works of Enlightenment thinkers