I have heard of this before and I think there is no sure explanation.
Definitely you need medical care, maybe and IV to get hydrated.
There are a few things that can make a body reject water to some degree but these are just my guesses, definitely see a gastroenterologist and possibly an endocrinologist.
Some sort of acid reflux could be behind or gastritis. Hormones knowlingly affect the digestive system and if your hormones are out of whack they could cause things they shouldn't.
Once you are already dehydrated badly your body will reject water even more.
There is some evidence that suggests that a lack of magnesium, vitamin B and other critical nutrients can bring on severe morning sickness...which could result in making it harder to keep water down.
For me eating certain foods caused slight stomach acid problems in pregnancy. I am fine when I leave out starches and foods high in carbs. These foods also result in nausea for me. I have been nausea free in pregnancy by cutting them out, supplementing with magnesium and eating Vitamin B rich foods.
Have you tried getting water from fruits? Maybe your body will tolerate it better from oranges, cucumber, tomato etc.
Have you tried carbonated water?