The increasing severity of global climate change has made reductions in carbon emissions an urgent global issue. The relative lack of carbon footprint analyses of urban public transportation systems (UPTS) is therefore surprising, given that UPTS is an important component of urban transportation and one that may play a crucial role in carbon emission reduction. This study conducts a spatio-temporal analysis of carbon footprints for UPTS during the COVID-19 pandemic based on smart card data in Beijing. Since the core of carbon footprint calculation is to estimate travellers' trip trajectories and the ridership of urban rail transit (URT) and buses, we construct a novel multi-layer urban rail network model to calculate passenger volume and travellers' trajectories through a traffic assignment model. Furthermore, we utilize the Generalized Additive Model (GAM) to analyse the correlation relationship between the carbon footprints of buses and URT. Additionally, we conduct statistical analysis of the carbon footprint of UPTS. The results of the spatio-temporal analysis of carbon footprints for UPTS show significantly lower carbon emissions during holidays compared to those on working days, and emissions during peak hours contribute approximately half of the total daily UPTS emissions, while there are notable variations in the distribution of the carbon footprint among different districts. Moreover, our analysis reveals a positive correlation between the carbon footprints of buses and URT. The statistical analysis reflects different patterns of carbon footprint distribution on different dates during the pandemic, but the carbon footprint distributions on selected dates all follow a power-law distribution. This study may facilitate the understanding to the impacts of UPTS on the environment during the COVID-19 pandemic, and also provide important guidance and reference for the development of carbon emission reduction strategies.