Such conflicts are simply prevented by the service being provided to boaters by the government......
I'd say that most places I've been, have a trash container for the boaters. Some, such as Cuttyhunk, requires a $5 per bag fee paid on the honor system. I'm guessing the tone of this thread would suggest a dump and dash was entitled, because one bought some ice cream and a lobster on the island.
I've been to marinas and town docks that have explicitly stated there is no trash facilities. Therefore, I either find some permission ashore somewhere, or I store it to the next anchorage. Pretty simple.
Often, it's clear (small island) that trash removal is a real problem for them and they can't handle the added load. I highly suspect, in other cases, our cruising brethren have ruined it for the rest of us.
p.s. The government can't pay for anything whatsoever, they don't make any money. The rest of us pay for whatever they provide. There are good reasons for doing so, but I'll bet those that live ashore aren't so interested in underwriting our cost of trash removal.