Soldiers would sometimes go for a month or more without a shower or a change of clothes. When you are getting shot at on a regular basis, you don't drive back to the barber shop to get a trim. Front line soldiers were not hassled about hair styles or uniform regulations; It would have been impossible to maintain those standards and that was the kind of chickenshit that destroys morale and would endanger officers. If you are familiar with the "Willie and Joe" cartoons of the era, the guys were depicted as being dirty, unshaven, and with wild hair. (not far from the mark)
One issue that rarely appears in WWII histories, is that during WWII, most front line soldiers in all armies, of all nations, had to deal with body lice infestations. Given a choice a lot of these folks would have preferred to have no body hair for the little white knights to hide in. The first step for front line soldiers being moved to rest and replenishment areas was a delousing, a shower, and recycled clean uniforms. (part of the delousing process was the soldier being dusted with copious amounts of DDT)
The photos of Basilone and Murphy were taken far from the shooting. That photo of Murphy was probably taken after the war.
When I was in Navy boot camp, the first steps of becoming a sailor was to have all of your civilian clothes taken away and sent home, getting all of you hair cut off and getting a uniform. Boot camp consists of first, destroying any vestiges of individuality, they strip you of everything, keep you off balance mentally and keep you stressed. After some weeks of harassment, to make sure that you are sufficiently "broken" they begin to rebuild you into Sailors, Soldiers, Airmen or Marines. It is a very effective technique and succeeds for a very high percentage of people. After basic training they allow you more freedom and more individuality within certain limits.
In boot camp, some of us caught on pretty quickly to what was happening. (others never got it) Those who understood had a lot easier time of the basic training. We were able to smile (on the inside) and watch the process with some detachment and even amusement.