I recommend, and usually carry, three hats on my Caminos:
1. A ubiquitous ball cap. The stiff bill works well under a poncho hood. Mine is from Adidas and is a neon safety yellow, polyester fabric. It is hanging from my shirt in my Avatar...see photo to left. Also, it does double duty for high visibility. I also wear it for casual use too.
2. A knit beanie or watch cap to keep your head warm in the coldest weather you will encounter. Mine is from Outdoor Research (OR) is microfiber and is neon safety yellow. Works well for sleeping in cold albergues too.
3. A lightweight sun hat with good ventilation. This is the ubiquitous "bucket" or "boonie" style hat. GET ONE WITH A CHIN CORD. Mine is from OR and weighs nearly nothing, and folds up VERY small. I carry it in a pocket. It is best in hot sunny weather, but NOT good under a poncho. When worn under a poncho the brim channels water down my back...not good!
My primary considerations for obtaining each hat are lowest weight for purpose, and being able to fill at least two purposes: e.g. rain hat, sun / shade, warmth, or a combination.
One new idea that ticks several boxes is the BUFF Cap. Ivar sells them in his online store. I first saw them while working at the Pilgrim Office last July / August. I was fascinated when other pilgrims arrived wearing them and asked to inspect them.
They come in Camino centric designs, just like the BUFF microfiber tubes. The material is the same as a BUFF. The brim is stiff foam. It is one-size fits all with a pull-toggle adjustment.
This baseball-styled hat works for: sun protection (minus the wide brim); cooling (if you wet it); warmth (if you wear it dry); organizing hair; and giving shape to a poncho or other rain hood. It is virtually weightless. I just obtained two of them with the sello logo fabric and plan to field test this April on my next Camino. I found mine searching on the internet, as Ivar's stock ran out...check with him now.
Hope this helps.