A growing body of recent research suggests that in wealthier and more gender-egalitarian countries, gender differences in attitudes to, graduation rates in, and occupational preferences for disciplines related to science, technology, engineering, and mathematics are larger. These findings contradict the gender stratification hypothesis, i.e., that enhancing gender equality reduces the gender gaps disadvantaging girls. This study examines the educational-gender-equality paradox concerning motivation for learning mathematics using country-level panel data analysis. The analysis expands the Trends in International Mathematics and Science Study’s twenty-year cognitive trend scale by including the Second International Mathematics Study. We apply a market-basket approach with item response theory modeling to construct comparable motivation scales of the student questionnaires that account for both cultural and longitudinal differences. Our results suggest that the economic development of a country is associated with the country-level gender gap in intrinsic motivation, potentially influencing pupils with a lower parental education background more.