The design and synthesis of nanomedicines capable of regulating programmed cell death patterns to enhance antitumor efficacy remain significant challenges in cancer therapy. In this study, we developed intelligent DNA nanospheres (NS) capable of distinguishing tiny pH changes between different endosomal compartments to regulate pyroptosis or apoptosis. These NS are self-assembled from two multifunctional DNA modules, enabling tumor targeting, acid-responsive disassembly, and photodynamic therapy (PDT) activation. By modifying the embedded i-motif sequence, the NS can be activated in early endosomes (EE) or lysosomes (Ly), producing singlet oxygen (1O2) at specific locations under laser irradiation. Our results demonstrate that EE-activated PDT induces gasdermin-E-mediated pyroptosis in tumor cells, enhancing antitumor efficacy and reducing systemic toxicity compared to Ly-activated apoptosis. This study offers new insights into the design of endosome-activated nanomedicines, advancing the biomedical applications of targeted cancer therapy.