The invention provides a preparation method of a modified HZSM-5 molecular sieve catalyst. The method includes the following steps that firstly, a nano aggregate HZSM-5 molecular sieve, pseudo-boehmite, nitric acid, water, methyl cellulose, polyethylene glycol and tween are evenly mixed in the mass ratio of 1:(0.1-0.5):(0.02-0.08):(0.2-0.8):(0.005-0.05):(0.002-0.008):(0.002-0.008), extruded and formed, drying, bar breaking and calcination are conducted, and a catalyst precursor is obtained; secondly, the catalyst precursor is soaked in a mixed solution containing a proper amount of magnesium nitrate and zinc nitrate or a mixed solution containing calcium nitrate and zinc nitrate, dried and calcinated to obtain the modified HZSM-5 molecular sieve catalyst, wherein the massic volume ratio of the catalyst precursor to the mixed solution is 100:(1-5) (g / L). When a catalyst in the method is applied in a reaction for preparing gasoline with methyl alcohol as the raw material or methyl alcohol and naphtha as mixed raw materials, the methyl alcohol conversion rate and the oil product yield can be increased, the content of durene is remarkably reduced, and the octane number of the gasoline is increased. Methyl alcohol and naphtha serve as the raw materials to synthesize the gasoline, the heat exchange process is optimized, and the octane number of naphtha and the gasoline yield are increased.