This study aims to complement the advantages of SiO2 aerogel and melamine foam (MF) to produce high-performance building insulation materials. The optimal sol–gel scheme was determined by controlling system temperature, water content, amount of ethanol and amount of acid-base catalyst (orthogonal experiment). The density and porosity of MF/SiO2 aerogel were regulated by adjusting aging time, aging temperature and type of aging agent. Furthermore, the effects of different volume fractions hydrophobic modifier on the surface free energy and wettability of MF/SiO2 aerogel were also investigated. The experiment results showed that the prepared MF/SiO2 aerogel satisfies requirements for low density (0.089 g/cm3), low thermal conductivity at room temperature (0.0256 W m−1·K−1), and excellent hydrophobic performance (the contact angle was 140.1°). Meanwhile, it was found that SiO2 aerogel was stably and uniformly distributed in the pores of the MF and effectively enhanced the mechanical property (a maximum compressive strength of 0.2058 MPa), heat-shielding performance, flame retardant property, and sound absorption capacity(αmax = 0.76, αave = 0.31).Therefore, the MF/SiO2 aerogel composites exhibit exceptional application potential in comparison to conventional building insulation materials (such as EPS, Rock wool board, etc.) due to their significantly low thermal conductivity and remarkable flame retardant properties.