While I agree that the main point is deterrence, the rules have changed in the last 50 year and it's not always a country vs country. Israel created their nuclear program to deter an all out war that could lead to Israel destruction but today Israel isn't fighting their direct neighbors in a conventional warfare.
Nukes in the hands of North Korea are bad no matter what, don't underestimate a mad man and their cult followings.