Epidemic models study the spread of undesired agents through populations, be it infectious diseases through a country, misinformation in social media or pests infesting a region. In combating these epidemics, we rely neither on global top-down interventions, nor solely on individual adaptations. Instead, interventions commonly come from local institutions such as public health departments, moderation teams on social media platforms or other forms of group governance. Classic models, which are often individual or agent-based, are ill-suited to capture local adaptations. We leverage developments of institutional dynamics based on cultural group selection to study how groups attempt local control of an epidemic by taking inspiration from the successes and failures of other groups. Incorporating institutional changes into epidemic dynamics reveals paradoxes: a higher transmission rate can result in smaller outbreaks as does decreasing the speed of institutional adaptation. When groups perceive a contagion as more worrisome, they can invest in improved policies and, if they maintain these policies long enough to have impact, lead to a reduction in endemicity. By looking at the interplay between the speed of institutions and the transmission rate of the contagions, we find rich coevolutionary dynamics that reflect the complexity of known biological and social contagions.