Yup - keepin' the bird cool in hot weather, and as a male sexual display thing.
It is likely that there are a couple issues involved in the sexual-display thing. First, they make it real clear who's the guys and who's the girls (always a good starting point for any mating encounter intended to produce offspring
).
Second, the size of the comb may offer some information about how, what would you call it, well-grown and strong and robust and long-term healthy is the male wearing it. Females of many species have been shown to select for male traits that are correlated with individuals who've grown better; which makes sense because there is probably often *some* genetic contribution to those males having done better for themselves.
And third, I do not offhand know of any studies involving chickens, tho I expect they've been done, but it is pretty common for males (in species with female choice AND in species with lots of male-male aggression) to have some body part whose color etc reflects the individual's current health. I would not be surprised if, with chickens, if you artificially reddened a sickly roo's comb or put pale makeup on a healthy roo's comb, it would change the likelihood of physical attack by other males and perhaps affect female chickens' willingness to mate. (In a small enclosure the females may not get lots of choice but in a large space it can be different).
Pat