It wasn't really a mistake. At the time Taiwan and South Korea were advancing into semiconductors, the US was more concerned with Japanese domination of the industry so having 2 small countries as alternatives to compete with Japan in some sectors of the industry was beneficial.
One of those small countries has a belligerent neighbor to the north, and the other is coveted by a much larger superpower that thinks it still owns it.
The NK situation was obviously widely known at the time, but that the US population/government didn't forsee or take seriously enough the rise of China is perplexing to some of its allies.