This mainly has historical reasons: In the 5th century, Vandals (a Germanic people) came to south Europe, being seen as danger. So the South Europeans wanted to flee to a safe spot. While doing that, some random south European thought „yo what if we build a city in the middle of a lagoon to protect ourselves from the Vandals?“ So they did. And it worked. And Venice was created. (Sry for the long & nerdy text)