The code of Bushido considered it a shame to surrender to an enemy, so the Japanese treated their prisoners thusly. Many times they just ritually executed prisoners on the spot.
Look how Stalin treated the returning Soviet POWs, most where either killed or sent to Siberia. He considered any Red Army soldiers who were taken prisoner to be 'traitors'.