Most Labrador Retrievers love to swim. Labradors, as a breed, are predisposed to ear infections. Swimming can trigger ear infections in some dogs.
Labradors and other floppy-eared breeds are prone to ear infections because the large external portions of their ears impede the circulation of air into the ear canal. This causes moisture to build up. Moisture promotes ear infections.
Dogs that swim also may develop excessive moisture in their ears through an obvious mechanism. This is why swimming triggers ear infections in some dogs.
Fortunately, solutions that remove moisture from the ear canals are available commercially. Over-the-counter formulations can be purchased at pet stores. More effective (in my experience) prescription ear solutions are available through vets.
Your vet can explain how to use ear drying solutions safely. If you use such a product after each of your dog’s swimming sessions, the ear infections might not occur.