I would probably do one of two things:
If I want water to be a real problem for them, I would probably make them do some sort of check to successfully cast. On a failure they waste their action but keep the spell slot. I would only do this if A) there was an accessible way around the limitation, or B) being in the water is supposed to be a penalty.
If I wasn't trying to make water a penalty mechanic or something, or there was no accessible way to deal with it, I would just let them cast normally.
Importantly, I would not penalize spellcasters without also penalizing non-spellcasters, or vice-verse.