I don't think that the premise of this question (that Japan and South Korea have avoided corruption, unlike the rest of East Asia) really holds up. If you look at the Economist's Democracy Index, and Transparency International's Corruption Perceptions Index, you'll find that things are a little more complicated in that region.
You're right that South Korea and Japan are at the top of the DI in Asia. But Taiwan is up there with them, and other East and Southeast Asian countries, such as Malaysia, the Philippines, Singapore, Indonesia, and Hong Kong are in the "flawed democracy" category as well (albeit at the lower end).
On the CPI, Singapore leads in East and Southeast Asia by a large margin, and is tied for the 3rd least-corrupt country in the world. Japan sits at number three in East/Southeast Asia, just behind Hong Kong. Taiwan is next, then South Korea, whose score of 57 puts it in the "middling" range, close to countries such as Rwanda and Costa Rica.
To address the question itself: When talking about the economies of these countries in the 20th century, economists like to refer to the "Japanese Economic Miracle" and the "Miracle of the Four Asian Tigers" (South Korea, Taiwan, Singapore, and Hong Kong), essentially asking "How did these five impoverished countries, ravaged by World War II, create their highly-developed economies within a generation?" *
Likely factors include: a high degree of state intervention in the economy, an emphasis on export-oriented policies, low taxes for foreign corporations, and early investment in infrastructure, technological innovation, and universal primary education. At the time, there were few limits to state power in any of these countries, so economic directives from the top could be implemented quickly and effectively. Some writers and politicians include a "cultural" factor into the mix, claiming that there is a certain set of "Asian values" such as hard work, stability, collective success, and respect toward authority. This same set of values was used to explain why these countries retained their authoritarian governments—until, of course, they didn't.
South Korea and Taiwan both experienced peaceful democratic revolutions in the 1980s, a development that many political scientists attribute to their newly-educated, aspirational, and globally-aware young populations who wanted a greater say in their futures (both revolutions were initiated by student groups). And in 1993, Japan's Liberal Democratic Party, which had ruled the country since the end of the American occupation, lost their parliamentary majority for the first time and peacefully ceded power to the opposition, a huge milestone in solidifying democratic institutions in any country. Hong Kong and Singapore made democratic and transparency reforms during this period but never transitioned into fully democratic states.
Answering why a country did become a democratic state is a lot easier than speculating on why one didn't, so I'm not going to touch on the remainder of East and Southeast Asia. Suffice to say there's a whole lot of variation across the continent, and each country has its unique set of advantages and challenges.
* Scholars are finally beginning to reconsider using the term "miracle" when discussing these developments. Using the term "miracle" implies that the success of these countries could have only come from sheer luck or an act of God, which feels pretty condescending.