It's in the genes. Color blindness is a genetic mutation that causes the receptors in the film layer of the eye (retina) to be unable to differentiate certain colors (blue, green etc.). There are several different forms of color blindness, related to the different mutations that can arise. Since most of us do not get the mutation, we have "normal" color perception.
Color Blindness. Color blindness is a manifestation of a wide array of diagnoses. It may be inherited as in x-linked color blindness (affecting males only) or acquired as in optic neuropathy. A long list of abnormal genetic diseases may cause color blindness including achromatopsia and others. Some forms of color blindness are relative and some are absolute where the patient only sees shades of gray.
Inherited. Most color deficiency is inherited and you will have the problem if you got the wrong gene. Only about 7% of males are color deficient and 1% severely so. Less than 1% of females are deficient. So most have normal color deficiency as they have the full amount of normal color recognizing cells in their retinas.