According to former Leatherneck editor, Col James A. Donovan, USMC (Ret), the red patches worn upon helmets and at the knees of the trousers by service battalions were the consequence of a Second Marine Division planners' conference early in 1944 dealing with lessons learned at the Battle of Tarawa.
It had been noted that there were too many Marines lingering on the beach behind the sea wall, helping with wounded and unloading supplies. They actually belonged on the forward firing lines with their rifle squads, but it was difficult to tell who the proper shore party and beach party were in the general confusion of those first violent hours.
The planners decided that a distinguishing square red patch on the helmet covers would help, but in the tropic heat, many men took off the hot helmets. A patch on the shirt sleeve where most unit patches were worn was not considered acceptable because again the troops in the rear areas frequently stripped off their uniform shirts in the burning tropic heat. So, assuming most Marines keep their trousers on in combat, the knee of the trousers was accepted as a good location for a little square red patch of cloth.