There are two ways the mud could be getting in the water that I'm aware of.
1) Your coop is dusty. The dust floats into the air and deposits into the water all day long accumulating into mud.
2) Chickens scratch the mud in or poop in it.
For #1 I would recommend adding a nice thick layer of bedding which will keep the soil below too moist to produce dust.
For #2, you first need to raise the water as high as you can where they can still drink (as many have already said). I put mine on top of two bricks, or sometimes I use an upside down flower pot. You'll find something. If it's still a problem, you can reduce the soil that is near the water. I have some pieces of slate that I've placed under the water so that there is nothing to scratch. Every now and then I'll sweep the slate clean, but it's a lot easier than cleaning the mud all day. If this platform is slightly elevated, even 1'', it will help keep it clean. Again, be creative here: you can use old floor tiles, a few pieces of wood laid next to each other, etc.
Another idea I've seen is a perpetually flowing water system. It's a little more complicated and not everyone can do it. The idea is that you have a water inlet coming from an uphill source like a lake or a river. You then run an outlet tube that empties at a lower point downstream. The constant flow of water will remove all the debris. Pump the water with a siphoning action to keep costs down.
Hope that helps!