Before the late 18th century, most barns were unpainted. Farmers did not paint the barn due to the cost of paint, and it would be costly to paint a barn, and why bother it was just used to house livestock.
However, the untreated wood was damaged by the natural elements, snow, rain, and sun. They improvised since the farmers could not afford to buy paint for such a large structure.
What worked best was a mixture of linseed oil from falx plants, milk, lime, and iron oxide. The Iron Oxide has a reddish rusty color and, when painted, gave the barns a reddish color, especially once the sun hit the barn; it was even redder.
However, it was in no way for an aesthetic; the iron oxide is known to keep moss and fungus from growing on surfaces, including a barn. The color absorbed the sun's rays faster than untreated wood, which helped keep the barns warm during winter.
Since then, the tradition has stuck, and red paint is even now one of the cheapest colors available due to the large amount of iron and oxygen compounds in the paint.
The tradition is said to have started in New England and has now become a tradition all over America.
So, next time you see a red barn, you can think of the history of why the barn is red.