Jimmy Carter visited North Korea in 1994 in order to defuse the impending North Korean nuclear crisis. The fact that a former US president visited North Korea to speak to their leader is a point of pride to North Koreans.
The nuclear weapons program serves as a prestige project that legitimises the validity of its government to the North Korean general population.