The Japanese warrior code of Bushido made no provision for surrender (or for prisoners of war). The typical response by Japanese troops, when faced with defeat, was the Banzai charge. The intent of the Banzai charge was suicide, but designed to kill as many of the opposing enemy as possible in the process. On the other hand, the American Marines wanted to live and return home. They employed the most firepower at their disposal to preserve their own lives and destroy the Japanese.
OK, when the Banzai charge is over and Japanese bodies are piled-up like cord wood — rapidly decomposing and stinking in the heat and humidity — what do you do? Remember, the battle still rages.
You do what is necessary for the health of the living: dig a pit with a bulldozer, and bury the remains in a communal grave. That's what war is like up close and personal. War is horrible, ugly, and full of misery.
Totally ignored is the war in the Pacific was fought without quarter — much the same as the fight against Islam — because those were the rules adopted by Japan (and by Islam). Repeat, the enemy set the rules of engagement — both then and now.
If your enemy believes that martyrdom and suicide are tools that will allow him to win, then all you can do is kill him to preserve your own existence. That's just the way it is. Deal with it.
Sounds oddly familiar these days...
More info: When the Japanese fortified Iwo, recognizing that the US would have to take the island..they dug over 20 miles of tunnels all through the island. The Marines weren’t aware of this until they landed. As they moved along the flat plain of the island, away from Suribachi..everytime they came across a tunnel opening, they would first fire flamethrowers inside, then use grenades and charges to collapse the tunnel openings. There may be as many as 10,000 Japanese interred inside these tunnels. The Japanese government will not open them, because of the danger of collapse. To give an idea of how vast, and intricate, and well supplied the tunnel network was, in 1949 ( I could be wrong about the date..it might be later) two Japanese soldiers were discovered. They had eluded capture for years..