North Korea uses server farms in China. Thus, to attack North Korea, we would have to attack China.
The problem is that our enemies are essentially dictatorships, and it is far easier for them to dictate effective security measures. Can you imagine the hue and cry if our government attempted to impose regulations that would protect us from cyber threats? People much prefer their freedom, even if it leaves them vulnerable to attack.
Of course, they also prefer to complain about how vulnerable we are to attack - but don't actually want to take the necessary steps to fix it.