Before the 17th century, almost all carrots cultivated were purple. The modern day orange carrot wasn't cultivated until Dutch growers in the 16th century took strains of the purple carrot, including yellow and white carrots and gradually developed them into the sweet, plump, orange variety we have today.
Some think that the reason the orange carrot became so popular in the Netherlands was in tribute to the emblem of the House of Orange and the struggle for Dutch independence. This could be, but it also might just be that the orange carrots that the Dutch developed were sweeter tasting and more fleshy than their purple counterparts, thus providing more food per plant and being better tasting.