This is a good question. Let me start off with some background information. The Manhattan project was a research program, led by the United States with a few more allied countries. They explored the possibilities of an atomic bomb during the context of World War II. The project was under the direction of Major General Groves of the United States Army. Ultimately, the succeeded and made the Atomic bomb.
In light of this background information, the reason why the United States did not share this information with Japan was due to the fact that they were in war with Japan. With that said, normal code of ethics do not apply in wartime. For example, in peace, it is not good to lie, but in war, misinformation, deceit, and other mischievous tactics are strategic. In a word, war changes things in terms of morals.