Why do you get cramps when you drink water during exercise?

Drinking too much. If you mean "stomach" cramps it may be because your drinking too much at one time. Make sure you have hydrated throughout the day before exercise. Drink 8 ounces over the hour before exercise then drink an ounce (good mouthful) every 15 min during. Eating properly - 3 balanced meals per day- are important too.
Cramps from fatigue. Over fatigue of the affected muscle is the usual cause not drinking water. Nevertheless low potassium may play a role sometimes, so drinking emergenc c with lots of vitamin c and potassium would always be better than water.