Electrochemical reduction of CO2 into high-value-added products is a potential approach to solving environmental problems but is limited by poor product selectivity and low efficiency. Metal-organic framework (MOF) materials have been considered one of the most promising catalysts, but their application is limited by complicated preparation processes, especially during the synthesis of organic ligands. In this work, a new three-dimensional Cu-MOF (JXUST-301) with high porosity was constructed based on the naphthalene diimide (NDI) ligand. Furthermore, JXUST-301 with ligand defects (JXUST-301D) originating from the missing NDI unit was synthesized via an in situ reaction. The presence of ligand defects endows JXUST-301D with a better CO2RR performance with a FEC2 of 56.7% and a jC2 of -162.4 mA cm-2. Mechanistic studies revealed that the hierarchical pore structure and amino sites are created from the absence of the NDI unit, which promotes the exposure of catalytically active sites and CO2 enrichment. Furthermore, the electronic structure of the Cu sites is modulated to upshift the d-band center, facilitating chemical adsorption and activation of key reaction intermediates. This work provides new insight into the in situ preparation of efficient Cu-MOF catalysts by introducing defects for the CO2RR.