To get to the other side.
Sorry that I don't have a better picture to help illustrate this but this
satellite shot might help explain my point. The are separate two community docks in this photo. Both communities have expansive beaches and it would be quite easy to walk from one to the other by the shoreline. What you can't see in this photo is one private residence with a smaller dock right on the beach between the two communities. The only other way to get from one community to the other would be via route 25. Are you telling me that you would go around, way out of the way and on a heavily traveled road, in order to go see a friend on the opposite beach?
As long as you are below the high water line it is not only legal but, IMO, reasonable to cross the beach and the dock to get from one place to the other. I wouldn't stop and go for a swim but I wouldn't consider it rude to cross, even if they had a party going on.