Current methods for measuring thermal errors due to spindle operation often capture data from other components, complicating the measurement process. Furthermore, data-driven modeling struggles to integrate structural thermal deformation mechanisms, resulting in poor model generalization. To address these challenges, the data-mechanism fusion digital twin (DT) system for spindle thermal errors modeling and compensation is established, which encompasses the physical entity layer (PEL), DT prediction layer (DT-PL), and DT interaction service layer (DT-ISL). In the PEL, information from the machine tool is collected. In the DT-PL, the thermal error experiment is designed to identify the spindle thermal errors, and the multi-channel ensemble algorithm leveraging the physical mechanism (MCEA-PM) is proposed to calculate the spindle thermal deformation. The DT-ISL handles thermal error calculation, data visualization, and interaction with machine tools. The effectiveness of the proposed system was evaluated, achieving over 90 % prediction accuracy and a 72 % increase in machining accuracy during processing.