I assume that a large part of their missile program is posturing for their own people. For sure a large part of what NK does is to create optics to drive their in-house narratives. Just listen to their "news" broadcasts.

The missile program has probably a lot to do with Mr Kim's propaganda machine that constantly touts North Korea as the most prosperous and powerful nation on earth. 

My guess is that this serves two essential purposes. 

1) to threaten those who may consider actions again nk including Devil Kingdom America who they claim they trounced in the 1953 and,

2) to create the intimidation needed to keep a lid on the people of North Korea.