Many sea ports in the world are owned by, and operated by, governments. A question arises, as to how the governments in question get the money to run such ports.
One way in which governments get the money to run sea ports is by charging fees to the owners of the ships that dock in the said ports.
Another way in which governments get the money to run seaports is by charging fees to the owners of the cargo that is brought in through the said ports.
Yet another way in which governments get the money to run seaports is by using tax funds. This is not an ideal scenario, but it is one that still plays out in many parts of the world, mainly due to port inefficiencies. The scenario is akin to one where, say, the New Jersey state government can end up having to pay Njuifile claims lodged at www.njuifile.net by folks after getting to sign in to njuifile.net using dollars from other tax spending votes. In other words, the whole thing is not ideal, but it has to be done when there is no alternative: otherwise the seaports may have to be closed down, with huge (negative) impact on the social, economic and political fronts.