Because
they already became a tributary state to China, they were invaded by
Japan and eventually were conquered by the Manchus. They felt like "a
shrimp among two whales", or in other words, inferior to the Japanese
and Chinese, so they started their own country and excluded all
foreigners except very few selected Japanese and Chinese.