In the very early days up until WW2 there were few minorities who could afford to fly. This created a natural segregation. After WW2 the planes themselves were not legally segregated although minority passengers would occasionally be asked to change seats. Also if a flight was overbooked black passengers would generally be bumped. To avoid problems like this Nat King Cole actually began hiring private flights. The airports themselves did have segregated facilities. Minorities were also not allowed to be crewmembers or pilots for any major airline until 1965.
Nice article by the Smithsonian
Similar to the United States, South Africa also had segregated facilities but not segregated flights. People of color would be the first asked to change seats or be bumped from flights.
Another form of segregation began in the early 1970's as airlines began experimenting with level of service fares such as business class, first class etc. Minorities were generally unable to afford the higher fares leaving first class a mostly white region. The Airlines purpose seems to have been profit with the segregation being incidental.