I looked at a few websites but can’t figure out why Venice was built in a marsh instead of on the nearby shore. Seems wasteful.
Short answer: islands are very economical to defend. Shoreline not so much.
My high school history teacher told us that Venice was founded the way it is because the tides made a great way to manage trash and sewage.
Frankly, the invasion/protection theory makes more sense, but is there any reason to think that the founders were considering sanitation as a factor?
There seems to be very little doubt that roman Aquiliea (built on the mainland) was abandoned and the core of present Venice constructed as Roman power declined and Germanic tribes moved through the area, often raiding, which serves to bolster the “refuge from invasion” theory.