We associate this habit with dogs, but cats love to do it, too. Why, especially if the cat has a perfectly good water dish available? No one knows for sure, except that we can assume these very independent creatures like to seek out their own watering places, just as they would in the wild.
A cat will drink not only from your toilet but from a birdbath, a fish bowl, a gutter or anything else with water in it, and cats aren’t fussy about whether the water is fresh or stagnant. The toilet-drinking habit seems disgusting, but remind yourself that your cat would not drink from the toilet if it contained anything besides water.