Answer by taking a quote from the following article:

Ira Hayes was born in Sacaton, Arizona, a town in the Gila River Indian Community in Pinal County. He was the eldest of six children born to Nancy Hamilton (1901-1972) and Joseph Hayes (1887-1978). The Hayes children were: Ira (1923-1955), Harold (1924-1925), Arlene (1926-1929), Leonard (1927-1952), Vernon (1929-1958), and Kenneth (born 1931). Joseph Hayes was a World War

The 5th Marine Division landed on Iwo Jima on February 19, 1945. Hayes's Second Platoon, Easy Company, 2/28 Marines, landed on the southern beach near Mount Suribachi off of the USS Talledega after transferring from the USS Missoula. On February 23, Marines from the Third Platoon of Easy Company, 2/28 Marines, captured and raised an American flag on top of Mount Suribachi at approximately 10:30 a.m.  In the early afternoon, Hayes's squad leader, Sergeant Michael Strank, was ordered to take three Marines from his rifle squad in Second Platoon, Easy Company, to bring supplies up Mount Suribachi and raise a larger flag on the summit. Strank chose Corporal Harlon Block, Private First Class Franklin Sousley, and Hayes for the patrol. Marine Private First Class Rene Gagnon, a battalion runner for Easy Company, was ordered up the mountain with the replacement flag. The four Marines together with Gagnon and Private First Class Harold Schultz (Navy corpsman John Bradley was misidentified as a flag-raiser until June 23, 2016), raised the second flag attached onto another steel pipe found by Hayes and Sousley, while at the same time the smaller flag came down. Schultz from Third Platoon, was part of the original 40-man patrol that climbed up Mount Suribachi.  On March 14, another American flag was officially raised at Marine headquarters at the base of Mount Suribachi to signal the Marine occupied Iwo Jima, and the flag on top of Mount Suribachi that Hayes helped to raise there was taken down. Hayes fought on the island until it was secure on March 26, and left Iwo Jima with his unit on March 27. Easy Company had many casualties, Hayes was one of five Marines remaining from his platoon of forty-five men including their corpsmen.  The raising of the second American flag on Mount Suribachi on February 23, 1945 was immortalized by AP photographer Joe Rosenthal and became an icon of the world war. Soon afterwards, the two surviving flag-raisers Hayes and Gagnon, and Bradley who was believed to be in Rosenthal's photograph, became national heroes. Harlon Block who was killed in action on Iwo Jima in March 1945, was misidentified as being Sergeant Henry Hansen from Third Platoon, Easy Company who was also killed in action. Hayes had attempted to correct the misrepresentation of his friend Block for Hansen (Hansen helped raise the first flag) in April 1945, but was silenced by a Marine Corps officer in Washington, D.C. who was placed in charge of the flag-raisers.

Why did he become identified as Hansen?
misidentified