Assuming this is in swamps, are you seeing them actually spawn IN the water, or just noticing them in the water, where they possibly spawned on land and decided to drown themselves?
I cannot reproduce this in a flat swampland world with one layer of water.
@Johnathan Most likely, slimes are jumping into the water and getting trapped since they can't jump. If you destroy all the dry land in your swamp, the problem will resolve likely resolve.
Assuming this is in swamps, are you seeing them actually spawn IN the water, or just noticing them in the water, where they possibly spawned on land and decided to drown themselves?