For many soils, the CEC is dependent upon the pH of the soil (clay). This is due mostly to the Hofmeister series (lyotrophic series), which describes the relative strength of various cations' adsorption to colloids, and is generally as follows:
Al3+ > H+ > Ca2+ > Mg2+ > K+ = NH4+ > Na+
As soil acidity increases (pH decreases), more H+ ions are attached to the colloids. They have pushed the other cations from the colloids and into the soil water solution. Inversely, when soils become more basic (pH increases), the available cations in solution decreases because there are fewer H+ ions to push cations into the soil solution from the colloids (CEC increases).
Havlin, Tisdale, Beaton, Nelson (2011). Soil Fertility and Fertilizers. New Delhi: PHI.
The CEC values of all clay minerals are pH dependent, since the CEC is determined by some combination of permanently charge sites (not pH dependent) and pH dependent sites.
A lot of systematic research was done on that question in our institute. What my colleagues mainly found out is that the charge of organic index cations used for CEC measurements strongly depends on pH. Those molecules get protonated or deprotonated in solution as a function of pH, which affects their charge. When these protonation reactions aren't accounted for, i.e. CEC is calculated using a constant charge of the concerned index cation, this results in an apparent pH dependency of the CEC. The work at CIM was mainly done on CuTrien, but these findings probably apply to molecules like MB just as well. A paper on the topic by Helge Stanjek is accepted by Clay Minerals (CEC determination with Cu-Triethylenetetramine: recommendations for improving reproducibility and accuracy) as should be out very soon.
So what Rafik and Steve explained probably holds to some extent, but it seems like a lot of the observations of pH dependency of CEC can at least partly be explained by a pH dependency of the CEC measurement rather than of the CEC itself. Evidently more systematic research is required on this issue.
The degree of CEC dependency on pH differs between the two basic types of clay minerals. The 1:1 clay minerals (kaolinite, halloysite, Etc.) have the greatest dependency because the CEC results from broken OH bonds at the edges of the clay particles. The higher the pH of the surrounding solution, i.e. higher OH ion concentration more H ions are attracted from the OH bonds of the clay structure and the higher the CEC of the clay. The 2:1 clay minerals (montmorillonite, and other smectites) most of the CEC is created by a substitution of Mg ions for Al ions in the octahedral layer (Mg2+ vs Al3+) leaving a negative charge on the clay surface that is not subject to change with the pH of the system. The CEC of the 2:1 minerals is much greater than in 1:1 minerals and although they also have a slight pH dependency due to broken OH bonds on their tetrahedral layer the effect is negligible. In soil samples containing organic matter the CEC dependency on pH is very great because the CEC of the organic molecules results from broken OH bonds as in the 1:1 clay minerals. In reporting CEC values the pH of the method of determination should always be stated. There are 3 basic CEC methods. 1) Effective CEC, (ECEC) is determined by extracting basic cations (Ca, Mg, K, Na) with ammonium and adding KCL extracted at the existing pH of the sample. 2) Determination at a buffered pH 7 by ammonia (Ammonium Acetate Method). 3) Determination at a buffered pH 8.2 also known as the Sum of Cations Method.