The only reason why President Truman and the pilots who dropped the bombs were not prosecuted as war criminals is because the United States ended up winning the war.
It has long been pointed out that Japan had expressed a willingness to surrender. The only condition was that the Japanese emperor not be abused or executed.
President Truman refused to agree to that condition. Like his predecessor Franklin Roosevelt, Truman demanded "unconditional surrender."
That was why Japan continued fighting. Japanese officials naturally assumed that U.S. officials were going to do some very bad things to their emperor, including torture and execution. In the minds of Japanese officials, why else would the United States not be willing to agree to that one condition, especially given that it would have meant the end of the war?
The dark irony is that Truman ended up accepting the condition anyway, only after he pulverized the people in Hiroshima and Nagasaki with nuclear bombs.
In an excellent op-ed in the Los Angeles Times today entitled "U.S. Leaders Knew We Didn't Have to Drop Atomic Bombs on Japan to Win the War. We Did It Anyway" the authors point out: