North and South Korea both claim to be the one true Korea with the other one being an illegitimate government. Historically, both sides have legitimate claims with Pyongyang and Kaeseong both being major capital cities of former dynasties during Korea's 5000 year history.
After the Korean War, both sides attempted to claim legitimacy on the international stage through diplomacy. They would sign deals with other nations usually with the caveat that those nations not recognize the other Korea. Naturally, the Cold War participants and their allies aligned with the respective Korea's with the Third World being the toss-up countries.
South Korea had much more recognition during the 50's and 60's due to the fact that the UN backed the South during the Korean War. In the early 1970's, North and South Korea began to talk and with that came more recognition for the North. By 1991, both Koreas wanted into the UN and were only allowed in on the condition that both of them were allowed in as separate, recognized countries.
As to why they have so few allies, that has to do with the collapse of communism. North Korea has mutual defense treaties with China and Russia. Previously, the Russia deal was with the USSR. At the DMZ, the northern neutral observers were from Poland and Czechoslovakia, two (now three) countries that have been part of NATO for the past 15-20 years. With the collapse of the Warsaw Pact, Soviet allies fell away leaving only Russia and China.
Why don't they get more allies? Who would want to be their ally? In the 1980's, the North attempted to assassinate the South's president in Rangoon, killing multiple people in the attempt, they blew up a Korean Air flight, and they kidnapped Japanese and South Korean civilians. In the 90's, they pulled out of the Non-Proliferation treaty and began pursuing nuclear weapons. You can look at what they've done in the last 20 years (VX nerve agent assassination in a major international airport?!?!) and draw your own conclusions as to why no one is rushing to jump on the North Korean bandwagon these days.