The invention belongs to the technical field of tertiary oil recovery, and particularly relates to an anti-swelling clay stabilizer and a preparation method thereof. The preparation method comprises the following steps: sequentially adding benzaldehyde-2, 4-sodium disulfonate, sodium cyanoborohydride, dimethylamine and methanol into a reactor, heating, refluxing, and evaporating to dryness; adding allyl chloride, sodium sulfite, copper chloride and ethanol into the reactor, stirring, heating, refluxing and filtering; adding ethyl acetate, heating for dissolving, filtering, cooling the filtrate to below 10 DEG C, and separating out crystals; adding 3-[(3-acrylamidopropyl) dimethyl ammonium] propionate, water, TX-10 and MS-1, uniformly stirring, continuously stirring, simultaneously dropwise adding 10% of an initiator solution, after dropwise adding, heating to 50-55 DEG C, keeping the temperature for 2-3 hours, adding sodium sulfite, stirring for 0.5-1 hour, adding potassium chloride and ammonium sulfate, and stirring for dissolving to obtain the clay stabilizer. The clay stabilizer has the advantages of high anti-swelling rate, high temperature resistance and washing resistance.