In the era of Education 4.0, the development of smart schools represents a significant step forward. Learning spaces are critical to the success of smart school construction in primary and secondary schools, due to their significant impact on school-age children. This study focuses on identifying key spatial factors that influence students' psychological preferences and learning utility in smart learning spaces. To achieve this, a visual stated preference method was employed to design a questionnaire, which was used to survey primary and secondary school students in Harbin, China. The resulting data was analyzed using a discrete choice model, which enabled the measurement of the utility levels of different learning space factors. The results show that students' learning space preferences are significantly influenced by a variety of spatial factors, with the combination mode of classrooms and outdoors having the highest level of influence, followed by a completely open interface, U-shape seating layout, zoned color tone, and the combination mode of classrooms and corridors; the students surveyed show a significant negative preference for heteromorphic spaces compared to rectangular spaces. The discussion recommends the design of smart learning spaces around key spatial factors to enhance the utility of student learning.