Does an employer have to provide drinking water to their employees?
Yes they do; consult the Welfare at Work publication by the HSE.
It is also stated in the Health and Safety at Work Act 1974 schedule 3 s10.
Can you simply leave if your workplace's water supply stopped working?
Not necessarily, I would consider factors such as time the workplace has been without water, whether the employer was prompt in fixing the issue, how impactful to work the lack of water was, was free water accessible in a nearby area etc. These are things that would support your case if you wanted to take your employer to court. Though it doesn't say you wouldn't be allowed to leave work, I'm not sure if the pure fact that the water supply has stopped working would be enough to justify you simply leaving the premises.