When and why did men stop wearing hats in the US?

When and why did men stop wearing hats in the US?