Immunity-driven evolution of virulence and diversity in respiratory diseases