Eye medication at birth

So I recently saw a video of a baby the docs were putting the gel in their eyes and I just wanted to know if it was necessary to expose a newborn to antibiotics if there’s no real problem, I mean me personally I’ve been getting yeast and bv infections the entirety of this pregnancy so I would probably allow it on account that I don’t know what I’ll pass when I give birth, but if that wasn’t the case I wouldn’t see a reason to. What are your thoughts tho?