I’ve seen speculation that red hats were used because the people had red hair.
Remember, they were a pre-tinfoil technology culture.
This was their attempt to keep alien space beams out of their statues heads.