The invention discloses heat-insulating and flame-retardant putty for a building wall body, which is prepared from the following raw materials in parts by weight: 28-33 parts of cement, 21-29 parts of hollow glass microspheres, 3.5-5 parts of tetraethyl orthosilicate, 31-38 parts of absolute ethanol, 0.35-0.5 parts of 1mol/L hydrochloric acid, 1.6-2.5 parts of template F127, 0.7-1 parts of emulsifier OP-10, 0.4-0.6 parts of sodium bicarbonate, 12-15 parts of silica sol, 0.3-0.5 parts of ammonium persulfate, 4-7 parts of light sand, 9-12 parts of coal ash, 4-6 parts of latex powder, 6-8 parts of polyester fiber, 1.8-2.5 parts of triphenyl phosphate, 3-4 parts of montmorillonite, 1-2 parts of grapheme, 5-6 parts of zinc acetate, 2-3 parts of ethylene glycol monomethyl ether, 0.6-1 parts of monoethanolamine, 13-16 parts of calcium bicarbonate and moderate amount of deionized water. The putty prepared according to the invention has the advantages of high adhesion, good water resistance, good corrosion resistance and crack prevention, and can be widely applied to internal and external walls of various buildings.