Small pelagic fish such as sardine show strong recruitment variability often associated with environmental changes influencing the spawning process and ultimately, affecting population dynamics. Sardine (Sardina pilchardus, Walbaum 1792) is one of the most exploited pelagic species along the northwest African coast. The main spawning occurs during the cold season (autumn–winter). A time-series autumn–winter surveys extending from 1994 to 2015 sampled sardine eggs, along the southern area of the Moroccan Atlantic coast (26°N–21°N) were analyzed. The present work focuses on examining the inter-annual variability of the spawning habitat by analyzing the spatial-temporal variability of sardine egg distribution and density extracted from the data collected over the period 1994–2015. Generalized additive models (GAM) were used to detect the relationships between the sardine distribution, expressed as egg density and the presence or absence data and relevant hydrobiological environmental variables, such as salinity, temperature and zooplankton biomass. The generalized additive models showed significant relationships between the environment variables (SST, SSS and Zooplankton biomass) and sardine density, but not with sardine presence. Given that the study area is characterized by high mesoscale features and significant upwelling activities, the variability of upwelling processes could explain the changes of spawning ground position and thermal window.