Even if these researchers have good intentions, they're human, and humans make mistakes. If someone doing gain-of-function research lets a new deadly virus or bacteria out into the wild by mistake, their mistake can can cause a pandemic like the one we're currently suffering from.
I don't think there's anything that we could learn from gain-of-function research on deadly viruses and bacteria that would be worth risking millions of deaths.