A method was developed for the determination of matrine residues in quinoa (Chenopodium quinoa Willd.) plants and soil by liquid chromatography triple quadrupole tandem mass spectrometry (LC-MS/MS) with QuEChERS clean-up. Matrine from soil, quinoa roots, stems, leaves and seeds was extracted with 25% ammonia, 20 mL acetonitrile/methanol, salted with sodium chloride (NaCl) and purified with anhydrous magnesium sulfate (MgSO4), N-propyl ethylenediamine (PSA) and graphitized carbon black (GCB). Then a chromatographic separation was performed on a Shim-pack XR-ODS II (75 mm × 2.0 mm, i. d., 2.2 µm) column with a gradient elution of 5 mmol/L ammonium formate-methanol as the mobile phase and monitored in multiple reaction monitoring modes (MRM) in electrospray positive ionization mode. The results showed that in the range of 0.005~1 mg/L, the linear correlation coefficients of matrine in the five matrices were all above 0.999. The LOQs for soil, quinoa roots, stems, leaves and seeds were 0.005, 0.005, 0.01, 0.01 and 0.005 mg/kg, respectively. The mean recoveries ranged from 74.42% to 98.37%, with RSDs of 1.25–6.84% at the three concentration addition levels. The average intra-day and inter-day recoveries were 73.92–92.36% and 78.56–90.18%, respectively, with RSDs below 8.72% and 9.43%. The recoveries and reproducibility of the method were superior. The method was used to determine the actual samples, which indicated that the half-lives of matrine in quinoa seeds, leaves, stems and soil were 1.28–1.32, 1.03–1.21, 0.81–0.92 and 0.93–0.97 d. It has a half-life below 30 d, which is an easily dissipated pesticide. The method is simple, sensitive, accurate, reliable and applicable to a wide range of applications, and it can achieve the rapid multi-residue determination of matrine to a certain extent. Next Generation Sequencing was used to explore the effects of exposure to high and low doses of matrine on soil bacterial communities and the composition of the three soils in the Qinghai Province (Haixi, Haidong and Haibei). The results showed that the number of ASVs increased significantly after treatment with matrine at an effective dose of 0.1 mg/kg than after treatment with matrine at an effective dose of 5.0 mg/kg. Similarly, bacterial abundance was higher after 0.1 mg/kg of matrine treatment than after 5.0 mg/kg of matrine treatment. The inhibitory effect on some bacterial flora was enhanced with an increase in matrine application, while the inhibitory effect on bacterial flora was weakened with time. Applying a certain dose of matrine e changed the relative abundance of the dominant bacterial genera of the soil bacteria.