Spatial ability is an important skill for art students, and its learning difficulty lies in the students' need to form abstract three-dimensional thinking and spatial perception. Common digital learning media (DLM) consume many cognitive resources and result in a limited spatial ability for students to learn. Previous studies have shown that virtual reality (VR) technology has unique advantages in improving spatial ability and training design thinking. This study uses VR technology to design an immersive learning environment (ILE) and discusses the differences between students' learning performance and cognitive load in DLM mode based on slides and ILE mode based on VR technology. Twenty-eight first-year university students participated in the experiment, divided into control and experimental groups based on their entrance grades and gender. The student's learning performance and cognitive load were obtained through academic ability tests and questionnaires. The experimental results show that the main effect of the learning environment is significant. Students in ILE have lower cognitive load and higher learning performance, and gender does not significantly influence cognitive load and academic performance. However, DLM increases students' cognitive load, and the cognitive load of females is higher than that of males. The results of this study provide a reference for future spatial ability learning and the impact of cognitive load on learning performance while also supporting efforts towards sustainable development by promoting innovative educational approaches aligned with the Sustainable Development Goals (SDG).