The invention provides a method for preparing a heterogeneous catalyst in the presence of a template agent for preparing isophorone through condensation of acetone. The catalyst is a modified composite oxide based on magnesium aluminum oxide: MgO‑Al 2 o 3 -M x+ o x / 2 . The preparation method comprises the following steps: weighing a certain amount of mixed salt and dissolving it in a certain amount of water, adding a certain amount of template agent, and dropping a certain amount of precipitating agent into the mixed salt solution at a certain temperature. The catalyst is obtained after aging, filtering, washing, drying and roasting. Compared with the prior art, the preparation method of the catalyst is simple and convenient, the price is low, the bulk density is small, the activity and selectivity are high, and the stability is good. In the reaction of acetone condensation to prepare isophorone, the reaction temperature is 250℃~300℃, under normal pressure, the mass space velocity of acetone is 1~8h ‑1 , the highest conversion rate of acetone is 45%, the selectivity of isophorone is 75%, and the selectivity of mesityl oxide and isophorone is 90%. This technology is suitable for industrial production of isophorone.