The red color in soil comes from iron oxide—essentially rust. Iron is abundant in many minerals (e.g., hematite, goethite). When exposed to oxygen and water, iron oxidizes, forming reddish-brown compounds that coat soil particles. This happens in:
The intensity of red indicates the degree of oxidation and drainage. It's the same chemistry that rusts a nail—just on a geological scale.