Strong spatial skills are foundational in predicting students' performance in science, technology, engineering, and mathematics education. Decades of research have considered the relationship between thinking spatially and how scientists reason and solve problems. However, few studies have examined the factors that influence improvement in students' spatial thinking during their school science curricula. The present study investigates the ThinkSpace curricula—two middle school astronomy units designed to support students' ability to apply the spatial skill of perspective‐taking (PT) while learning to explain lunar phases (3 days) and the seasons (8 days). U.S. students in 6th and 8th grades (N = 877) across four districts participated in the study, completing assessments before and after the ThinkSpace curricula, along with an additional group of students in 6th and 7th grades (N = 172) who participated as a spatial control group. Data collection included multiple‐choice content assessments, PT skill assessments, and interviews (from a sub‐sample of 96 students), before and after instruction. After participating in ThinkSpace curricula, students demonstrated improved spatial thinking within the domain of astronomy, as measured by improved written content assessments, increased application of PT during conceptual interviews, and a general measurement of PT skill. Higher initial PT skill and higher gain in PT skill predicted greater improvement in students' astronomy understanding, even when accounting for their initial content knowledge. Although ThinkSpace students in all demographic groups improved PT skill post‐instruction, 8th graders (who were in districts with lower SES), and females were predicted to have smaller gains in their PT skill than the 6th graders (who were in districts with higher SES) and male students. These findings suggest that middle school students' spatial thinking in science can be improved during their middle school science curricula, but questions remain concerning how to reduce spatial‐learning gaps that are associated with gender and possibly SES.