It would have been terrible if they'd locked Voyager in a box somewhere. And you couldn't plausibly make them just give up and settle. You don't take a ship to the other side of the galaxy to just have them sit there.
There's also a difference between being reasonably careful with unknown aliens and avoiding them completely. The whole idea of Star Trek is that they willingly face risk in order to explore the unknown. They know their curiosity could screw them and they accept and embrace it.