Originally, there was only convection, or hot water or steam, gas or oil heat, with a red & white wire. Then they added green for the fan when forced-air heat came about, and then yellow for the AC compressor when that was developed.
If you look at doorbell wire, it's either red/white and red/white/green, just like 2- and 3-conductor HVAC wire, respectively.
These colors were used as HVAC technology grew because that's how multi-conductor LV cables are made. It's just like our power cables: black/white, black/white/red, black/white/red/blue, etc., because that's how they're manufactured.
Added: Keep in mind that insulation color doesn't inherently mean anything. They're colored so we can tell them apart and identify the other end of each section. We've merely developed consistent methods of assigning them for use.
I've had more than one guy think that every white wire is a 'neutral,' even in switch wiring. I have to teach them that it's merely a wire that happens to white. If it's a neutral, it's because that's how it was connected, not because it's white.