Microbial solidification of sand has obvious effects: energy-saving and environmental protection. It is a green and sustainable soil consolidation technology with low energy consumption, which meets the needs of high-quality development of modern economy and society. However, when clay is doped in sand, clay has an uncertain influence on the effectiveness of the microbial solidification of sand. Therefore, triaxial consolidation undrained tests before and after microbial solidification of sands with different clay content are carried out in this paper. The effects of clay content on the solidification effect of sands are compared and analyzed. The variation laws of shear strength, unconfined compressive strength, internal friction angle and the cohesion of sands with different clay content before and after microbial solidification are discussed. The failure modes of sand samples were studied and the influence mechanism of clay on the microbial solidification of sand was revealed from a micro perspective. The test results show that the failure strain and unconfined compressive strength of microbial-induced calcium carbonate precipitation (MICP) treated samples increase first and then decrease with the increase in the clay content. The unconfined compressive strength is the highest when the clay content is 9%, and the samples with low clay content (3~9%) can still retain good integrity after being destroyed. As the content of clay in the sand–clay mixture increases, the internal friction angle of the sample decreases and the cohesion increases. After MICP treatment, the internal friction angle and cohesion of the sand increase first and then decrease with the increase in clay content. There are three main contact modes between sand-clay-CaCO3. When clay content is low, clay plays a filling role. The contact mode between sand-clay and CaCO3 is mainly between sand particles and calcium carbonate and between clay particles and calcium carbonate. When clay content is high, the contact mode between particles is mainly between clay particles and calcium carbonate. Higher clay content wraps sand particles, prevents contact between calcium carbonate and sand particles and reduces the strength of sand.