The invention provides a foaming filler for fixing a fence pile and a preparation method thereof. The foaming filler for fixing the fence pile comprises by mass percent a component A and a component B, the component A, by mass percent, comprises 72 to 81 percent of polyether 4110; 6 to 11 percent of polyether 403, 3.5%-5.2% of polyether 210, 3.7%-5.5% of polyether 330N, 0.2%-0.5% of water, 6%-12%of HCFC, 1%-8.5% of TCEP, 1%-2.5% of DMMP, 0.5%-2.0% of silicone oil, 0.2%-0.4% of A33 and 0.3%-0.5% of PC-8, and the component B, by mass percent, comprises 100% of PAPI. The foaming filling agent for fixing the fence pile has the advantages of being high in solidification speed and high in hardness after solidification, and can replace the concrete to be used as an industrial building material,at the same time, with the better fluidity, can be filled into the gaps to connect and fix.