Measures implemented in many countries to contain the COVID-19 pandemic resulted in a change in lifestyle with unpredictable consequences on physical and mental health. We aimed at identifying the variables associated with psychological distress during the lockdown between April and May 2020 in the Italian academic population. We conducted a multicenter cross-sectional online survey (IO CONTO 2020) within five Italian universities. Among about 240,000 individuals invited to participate through institutional communications, 18 120 filled the questionnaire. Psychological distress was measured by the self-administered Hospital Anxiety and Depression Scale (HADS). The covariates collected included demographic and lifestyle characteristics, trust in government, doctors and scientists. Associations of covariates with influenza-like symptoms or positive COVID-19 test and with psychological distress were assessed by multiple regression models at the local level; a meta-analysis of the results was then performed. Severe levels of anxiety or depression were reported by 20% of the sample and were associated with being a student or having a lower income, irrespective of their health condition and worries about contracting the virus. The probability of being severely anxious or depressed also depended on physical activity: compared to those never exercising, the highest OR being for those who stopped during lockdown (1.53; 95% CI, 1.28 to 1.84) and the lowest for those who continued (0.78; 95% CI, 0.64 to 0.95). Up to 21% of severe cases of anxiety or depression might have been avoided if during lockdown participants had continued to exercise as before. Socioeconomic insecurity contributes to increase mental problems related to the COVID-19 pandemic and to the measures to contain it. Maintaining or introducing an adequate level of physical activity is likely to mitigate such detrimental effects. Promoting safe practice of physical activity should remain a public health priority to reduce health risks during the pandemic.