In this study, a three-chamber air–cathode microbial desalination cell (AMDC) was constructed using activated sludge as the inoculating microbial source and carbon cloth as the electrode. The simultaneous bioelectricity generation, desalination, degradation of organic compounds, and nitrogen removal in the AMDC having different electrode spacings (16, 12, and 8 cm) provided an insight into the microbial community. The experimental results showed that with a gradual decrease in the electrode spacing, electricity production and desalination performance first increased and then decreased. While AMDC1 with 16 cm electrode spacing became active faster than other cells and reached a peak voltage of 598 mV on the tenth day, AMDC2 with 12 cm electrode spacing showed the best start-up performance with a maximum output voltage of 645 mV, maximum power density of 214.7 mW/m3, and minimum resistance of 516.9 Ω. AMDC3 with 8 cm electrode spacing reached a peak voltage of 598 mV, which was between those of AMDC1 and AMDC2. The three AMDCs were run until the end of the cycle, and there was no significant difference in their ammonium removal rate and chemical oxygen demand. For AMDC1–3, the desalination rates were 84.86%, 87.71%, and 83.43%, and the Coulomb efficiencies were 17.29%, 18.60%, and 17.95%, respectively. Further, scanning electron microscopy showed that a large number of microorganisms could attach to the surface of the anode carbon cloth electrode; 16S rRNA sequencing showed that the typical electrogenic microbial communities were Bacillus (11.6%) and Arcobacter (9.6%). As the poor performance of the AMDC was primarily due to a lack of electrogenic microorganisms in the active function of the anode chamber, screening the functional microorganisms provided a reference for optimizing and amplifying the application of microbial desalination cells in practical research.