Nipah virus is a bat-borne paramyxovirus that produces yearly outbreaks of fatal encephalitis in Bangladesh. Understanding the ecological conditions that lead to spillover from bats to humans can assist in designing effective interventions. To investigate the current and historical processes that drive Nipah spillover in Bangladesh, we analyzed the relationship between spillover events and climatic conditions, the spatial distribution and size of Pteropus medius roosts, and patterns of land use change in Bangladesh over the last 300 years. We found that 53% of annual variation in winter spillovers is explained by winter temperature, which may affect bat behavior, physiology, and human risk behaviors. We infer from changes in forest cover that a progressive shift in bat roosting behavior occurred over hundreds of years, producing the current system where a majority of P. medius populations are small (median of 150 bats), occupy roost sites for 10 years or more, live in areas of high human population density, and opportunistically feed on cultivated food resources - conditions that promote viral spillover. Without interventions, continuing anthropogenic pressure on bat populations similar to what has occurred in Bangladesh could result in more regular spillovers of other bat viruses, including Hendra and Ebola viruses.