The traditional gambrel (or Dutch) barn roof comes from northern Europe and prevails in places like Wisconsin and Minnesota with a heavy northern European heritage. Many immigrants to these states came from milk producing regions with specialized knowledge of cheese making.
Early on, these cheesemakers separated curds from whey and considered the latter a waste product, used for fertilizer and whitewashing agricultural buildings. To keep the whey from spoiling, they blended it with iron oxide, which rusts, yielding a dull red we refer to today as “barn red.”
Later, as milk producers were promoting the quality of pasteurized and homogenized milk, they wanted to show off its healthfulness and began painting their dairy barns white to advertise dairy’s nourishing and pallid purity.
Unprocessed milk, incidentally, is often not white, but pale yellow.
My Source: The Science of Cheese