The locks are necessary to overcome the topography: although the water levels of the two oceans connected by the canal are the same, the canal itself runs above world ocean level: over small mountains, hills, and just plains. If all the locks were opened, obviously the water from the canal would just "" into the oceans, only the outermost parts, near the oceans themselves, would remain.