The port has an advantage because it's in a fixed location with favorable features like a good harbor and nearby rail lines. The union has an advantage because the port needs workers who live close. It's perfectly natural to form these types of agreements - the port is a business trying to captures the market for people shipping goods to the area, and the union is a business trying to provide the labor required to do so.
When you say that others should be able to work and compete with unions without joining them, that's a moral position, not a legal position. (And, to be clear, it's not a bad position at all!) The legal position is that the contract will be exclusive, and both parties are agreeing to it.
Labor unions exist because people don't get what they deserve. They get what they negotiate.
Monopolies are the endgoal of "work itself out". Conway's Game of Life demonstrates this elegantly (and there's so many visualizations of it to fit your fancy).
>Workers should be able to organize and choose to strike, but others should be able to work and compete with unions without joining them.
due to the prisoner's dilemma this never really works out. You really need almost everyone behind a union to make it work.