You seem to be overstating the case here...
In "Dr. Bashir, I Presume" the supposed "flat ban on eugenics" is described thusly:
"DNA resequencing for any reason other than repairing serious birth defects is illegal. Any genetically enhanced human being is barred from serving in Starfleet or practicing medicine."
That's the long and short of it, as far as we know - even though the long of it is likely to be much, much longer outside our limited access to evidence. Here, the first half of the ban is on a specific technique, not on eugenics as such. And the second half doesn't ban supermen, it only prevents them from holding specific positions.
I could easily see the above law being consistent with "Unnatural Selection" in that research is perfectly allowable, even when application is not.
What "Cold Station 12" has to say on the subject is that Earth did indeed ban genetic engineering of apparently all sorts - resulting e.g. in the death of Archer's father. However, that ban might easily have been declared unconstitutional once the UFP was founded. Phlox and the Denobulans practice genetic engineering at the time, at any rate, as stated in "Borderland"; humans might have to yield to the will of the majority there.