Colorectal cancer (CRC) is the most common cancer worldwide and develops due to a broad range of causative factors. Pingxiao (PX) formula and Xihuang (XH) formula are two commonly used drugs to treat CRC, especially as an alternative therapy for those patients who could not suffer surgery, chemotherapy, or immunotherapy, namely, elder or advanced CRC patients. However, the pertinent pharmacological mechanisms are still elusive. The investigation was designed to explain the pharmacological mechanisms of the PX formula. A murine model of CRC was established by injecting CT26.WT cells into the caecum of 4-week-old male Balb/c mice, following PX or XH treatment for 30 days. Network pharmacology analysis combined with weighted gene coexpression network analysis (WGCNA) predicted the pharmacological mechanisms and therapeutic value. High-throughput 16S rRNA sequencing determined the alterations in the gut microbiota communities. Western blotting, immunofluorescence, and flow cytometry examined the influence of PX on the tumor microenvironment (TME). Injection of CT26.WT-induced CRC in Balb/c mice was markedly attenuated by PX treatment. Compared with XH administration, PX exhibited a stronger antitumor effect, such as smaller tumor volume, lower interleukin 17 (IL-17), IL-6 and tumor necrosis factor-alpha (TNFα) serum levels, and higher interferon-gamma (IFN-γ) concentration. Network pharmacology analysis demonstrated that both PX and XH targets were enriched in cancers and inflammatory responses. RNA sequencing confirmed that PX treatment induced cancer cell apoptosis and inhibited inflammatory reactions within the tumor. Moreover, the PX formula considerably restored homeostasis of the gut microbiota, which was not observed in the XH group. PX targets, those associated with the survival probability of CRC patients, correlated with macrophage (Mφ) infiltration, which presented an independent risk factor for the CRC outcome. PX treatment promoted the transition of alternatively activated Mφs (M2 Mφs) to classically activated Mφs (M1 Mφs). Moreover, the peritoneal Mφs from the PX group inhibited the migration of CW26.WT cells, as evidenced by the wound healing experiment and transwell assay, which was consistent with the decreased expression of the vascular endothelial growth factor (VEGF). Furthermore, the coculturing system confirmed that PX-treated Mφs suppressed colorectal tumor-derived organoid proliferation. PX formula exhibits a potential antitumor effect against CRC by suppressing the colonization of pathological microorganisms, reshaping Mφ effector functions and hence inhibiting cancer cell proliferation.