Domestic sewage can greatly affect the macro-micro physical-mechanical properties of building foundation soils. In order to investigate the effect of domestic sewage on physical and mechanical properties of soils, the physicochemical properties of three groups of different concentrations of domestic sewage contaminated soil were tested through indoor experiments. Combined with scanning electron microscopy, X-ray diffraction experiments, and grey relational analysis, the degree of influence of different concentrations of domestic sewage on the physicochemical properties of soil was compared and analyzed from multiple perspectives such as microstructure and mineral composition, revealing the influencing mechanism of soil pollution by domestic sewage. The results showed that under the immersion of contaminated water, the color of the soaking water turned black first and then yellow, and brownish yellow secretions appeared on the surface of the soil samples. The moisture content, specific gravity, density, and pore ratio index of the soil samples immersed in 50% and 100% domestic sewage decreased with the increase of sewage concentration, while the liquid limit of the soil samples changed in the opposite direction. The immersion time had little effect on the slope of the compression curve of the soil samples soaked in tap water. For the soil samples immersed in domestic sewage, the slope of the compression curve and the compression coefficient increased with the increase of domestic sewage concentration and immersion time, while the compression modulus showed the opposite trend. In the soil samples immersed in tap water, there were a large number of small particles and cementitious substances, and the structure was relatively dense. With the increase of domestic sewage concentration, the microstructure of the soil changed significantly, with the appearance of sigle particle structure, loose and disorderly arrangement of particles, increased and enlarged pores, gradual reduction of small particle substances and cementitious substances, and the soil structure transformed from compact to loose. The research findings can provide theoretical reference for contaminated geotechnical engineering.