Interesting that you'd select social Darwinism as an inherently pejorative phrase to apply to my selection here--I was thinking more of actual, genuine, biological change, through a very sophisticated form of breeding program.
My question then would have to be for what purpose exactly? IMHO, we've technologically progressed very far (too far) while our social development has almost come to a standstill. And it's rather frightening that the corresponding message from Charles Chaplin's speech / film "The Great Dictator" from over 70 years ago is as up-to-date as ever.
In Yoda's words "illuminated beings we are, not just that crude matter". And biological change is still "crude matter".
Why don't you propose an alternative answer? Not a "no God"-type equivocation, but an answer derived from Trek canon. And tell me why your choice would be better than Nagilum.
Fair enough! Now I couldn't possibly side with Nagilum or the Shadows because I believe wholeheartedly in the Golden Rule
(there must be some universal truth to it, after all Jesus said it and even Richard Dawkins agrees with it

I thought about the Organians ("Errand of Mercy"), first, but there goes free will.
Next the Metrons came to mind. What I really liked about their attitude was to deprive Kirk and the Gorn captain instantly of their "push the button" capabilities. Wanna kill each other? Fine, but then you have to get your hands dirty and nobody else is doing your dirty work, you two characters will do it yourselves.
If instead of modern military warfare, we'd be forced (civilized as we now are) to look our victims straight into the eye, I'd guess we'd already have a lot less of pain and agony.
Bob