Just because it is powered by electricity doesn't mean that water can't pass through it without hitting a live part. In fact there are quite a number of vacuum cleaners specifically designed to suck up liquids (though they are also designed not to throw them out the back!).
One possible way to design a "standard" vacuum cleaner is to use the "exhaust" air to cool the motor - this could well lead to fireworks when used to suck up water. However, there are at least two reasons to not design it in this way:
1) Just because you don't market it as a "wet and dry" machine doesn't mean that users won't try to clean up liquids or mixed wet/dry stuff - if you can find a cost efficient way to not electricute your dumber customers you should probably do it. 2) Even though the air is filtered before being expelled it will still be relatively dusty - if this passes through the motor it is likely to seriously reduce its lifespan.