Boiling with a lid on can cause some issues. There are sulpher compounds that are produced in the wort during the boil. With an uncovered pot, these farty-smelling things just boil off and evaoprate. If the pot is covered, those things can remain in the beer and you could taste them in the final product.
I wouldn't really worry about it, but something to remember.
As for bugs.... if they get in there, they will promptly die and be sterilized. They will not cause anything bad to happen to your beer (though it might be unsightly to see a fly or bee floating in the carboy.)
-walker