The negative impact of floods on public health has been increasing, as climate change makes these events more frequent and intense. Floods are known to cause direct injury and favor the spread of many waterborne and vector-borne pathogens. Their effect on the circulation of respiratory pathogens, like influenza and SARS-CoV-2, is, however, still unclear. In this study, we quantify this effect through the analysis of large-scale behavioral data coupled to mathematical models of epidemic spread. We focus on the devastating floods occurred in Italy in 2023 and measure how they impacted human contact patterns within and between communities. We find a substantial increase in contacts occurring 3 weeks after the floods, both among residents of the affected areas and between them and those living in distant, unaffected areas of Italy. Then, through mathematical simulations, we determine that these disrupted contact patterns can carry a circulating pathogen to previously unaffected geographic areas, as well as increasing infection counts across the country. Our findings may help set up protocols to use large-scale human contact data to contain epidemic outbreaks before, during and in the aftermath of floods.