When estimating soil organic carbon (SOC) using visible and near-infrared (Vis-NIR) spectra measured in situ, the interference of soil moisture content (SMC) needs to be eliminated. The existing SMC removal methods are mainly based on spectral transformation, but they change the original form of the soil spectrum. In this paper, a new deep learning-based SMC influence removal network (MIRNet) is proposed to establish the relationship between the spectra of moist soil and that of dry soil. This method constructs a spectral extraction module (SEM) with two one-dimensional (1-D) ghost modules to extract soil spectral characteristics and a context extraction module (CEM) with a two-layer dilated convolutional neural network (DiCNN) to extract the context information of the spectra. Then these extracted features are combined to reconstruct the SMC influence with a two-layer deconvolution using residual learning (Res). Finally, a new loss function that combining spectral distance and spectral shape measurement (D-S loss) is proposed. The input of MIRNet is the moist soil spectra, and the output is the dry soil spectra. Black soil collected from Harbin and yellow-brown soil collected from Nanjing are selected as the research objects. The <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"><tex-math notation="LaTeX">$R^{2}$</tex-math></inline-formula> reaches 0.703, 0.747, 0.907, 0.892, 0.866, 0.907, and 0.926, respectively, when using spectra processed by external parameter orthogonalization (EPO), orthogonal signal correction (OSC), support vector regression (SVR), convolutional neural network (CNN), deep neural network (DNN), denoising convolutional neural network (DnCNN), and MIRNet. Therefore, the proposed MIRNet achieves competitive results compared with these state-of-the-art methods.