Honestly, it's an extremely reactionary attitude. I can imagine the TOS writers saw Kahn as something like the bad end the Nazis were going for when they wrote that episode so soon after WW2. They weren't alone. John Russell Fearn created 'The Golden Amazon' during WW2. She was a product of medical alteration to turn her into a superwoman who started out much like Kahn in her origin. She was going to take over the world to bring peace. I guess the TNG writers simply expanded on that backward take that genetic alteration leads to evil ends. I can't see that genetic alteration that eliminates cancer would be a bad thing but it evidently would in the Federation.
The "genetic engineering is bad kids!" thing came about on DS9 in order to give Bashir a tragic backstory. TNG said nothing negative about it, and portrayed several colonies which augmented themselves genetically.