As recently as medieval times, when towns got sacked it was somewhat common to dump some dead bodies down the local well to make it unusable.
In times of peace it was normal to keep a cover over the well so things did not fall in. They might not have known germ theory but they knew a dead body in the water was not healthy.
If people started getting sick one of the first thing they would do is send someone down the well to see if there was any sign of something wrong.