Insomnia is a common comorbidity symptom in major depressive disorder (MDD) patients. Abnormal brain activities have been observed in both MDD and insomnia patients, however, the central pathological mechanisms underlying the co-occurrence of insomnia in MDD patients are still unclear. This study aimed to explore the differences of spontaneous brain activity between MDD patients with and without insomnia, as well as patients with different level of insomnia. A total of 88 first-episode drug-naïve MDD patients including 44 with insomnia (22 with high insomnia and 22 with low insomnia) and 44 without insomnia, as well as 44 healthy controls (HC), were enrolled in this study. The level of depression and insomnia were evaluated by HAMD-17, adjusted HAMD-17 and its sleep disturbance subscale in all subjects. Resting-state functional and structural magnetic resonance imaging data were acquired from all participants and then were preprocessed by the software of DPASF. Regional homogeneity (ReHo) values of brain regions were calculated by the software of REST and were compared. Finally, receiver operating characteristic (ROC) curves were conducted to determine the values of abnormal brain regions for identifying MDD patients with insomnia and evaluating the severity of insomnia. Analysis of variance showed that there were significant differences in ReHo values in the left middle frontal gyrus, left pallidum, right superior frontal gyrus, right medial superior frontal gyrus and right rectus gyrus among three groups. Compared with HC, MDD patients with insomnia showed increased ReHo values in the medial superior frontal gyrus, middle frontal gyrus, triangular inferior frontal gyrus, calcarine fissure and right medial superior frontal gyrus, medial orbital superior frontal gyrus, as well as decreased ReHo values in the left middle occipital gyrus, pallidum and right superior temporal gyrus, inferior temporal gyrus, middle cingulate gyrus, hippocampus, putamen. MDD patients without insomnia demonstrated increased ReHo values in the left middle frontal gyrus, orbital middle frontal gyrus, anterior cingulate gyrus and right triangular inferior frontal gyrus, as well as decreased ReHo values in the left rectus gyrus, postcentral gyrus and right rectus gyrus, fusiform gyrus, pallidum. In addition, MDD patients with insomnia had decreased ReHo values in the left insula when compared to those without insomnia. Moreover, MDD patients with high insomnia exhibited increased ReHo values in the right middle temporal gyrus, and decreased ReHo values in the left orbital superior frontal gyrus, lingual gyrus, right inferior parietal gyrus and postcentral gyrus compared to those with low insomnia. ROC analysis demonstrated that impaired brain region might be helpful for identifying MDD patients with insomnia and evaluating the severity of insomnia. These findings suggested that MDD patients with insomnia had wider abnormalities of brain activities in the prefrontal-limbic circuits including increased activities in the prefrontal cortex, which might be the compensatory mechanism underlying insomnia in MDD. In addition, decreased activity of left insula might be associated with the occurrence of insomnia in MDD patients and decreased activities of the frontal-parietal network might cause more serious insomnia related to MDD.