The port complex may be L.A.’s greatest economic asset. Not only do thousands of warehouses and trucking firms depend on it, but so do L.A.’s many apparel companies, toy wholesalers and furniture companies, to pick a few.

Unfortunately, Mayor Antonio Villaraigosa has chosen to politicize the Port of Los Angeles, weighing it down with his plan to promote union workers to such a degree that the port may have trouble keeping up with competition it will face in 2014. That’s when the widened Panama Canal will open and big container ships that are now forced to come here will be free to go to East Coast or Gulf Coast ports.

Oh, well, I thought, at least the Port of Long Beach next door is well managed, highly regarded by shippers and relatively free of political meddling.

Alas, no more.

That’s because Long Beach voters last week approved Measure D, a smash-and-grab engineered by the city’s political types that will snatch millions of dollars a year – maybe tens of millions – from the port, perhaps weakening its ability to invest in itself and keep up with the new competition.

Who can blame the voters? They read a ballot measure and heard an argument – to the extent they heard any argument at all – that seemed reassuring. The city claimed that Measure D creates a “more transparent, fair and reliable” method by which the port gives money to the city. And it merely “clarifies” that oil operations at the port are the purview of the city. If that’s all I saw, I’d vote for it, too.

But the measure basically is a city raid of the port’s funds. (The port is owned by the state but run by a city-appointed commission.) The more “transparent and fair” method really just boosts by $1 million or so the amount of money the city extracts as a payment from the port each year. Separately, the clarifying statement simply clarifies that the city can confiscate all the money the port gets from its oil production operations – which now may be $30 million a year or more. All this to plug the city’s own budget hole.

If voters didn’t understand, it was because Measure D was proposed and rammed through quickly. There was little debate. Staffers were sent a memo not to talk about it. Harbor commissioners who asked the City Council to slow down – one said she was concerned about the lack of discussion – reportedly were berated publicly by Mayor Bob Foster and others.

One study pointed out that Measure D could rob the port of 20 percent of its net income a year. That comes at the same time the port is looking at $3 billion worth of capital improvement projects – its Middle Harbor program, the Clean Trucks Program, replacing the crucial but crumbling Gerald Desmond Bridge.

With less money, the port may be forced to scale back its investments in itself. It may have to borrow less – and pay more. The Bond Buyer reported before the election that the port’s bond rating could “come under pressure” if Measure D passed.

Of course, the port could raise rates on its customers. Those would be the same customers who are wondering now if they should set up operations on the other side of the Panama Canal.

But Mayor Foster sure looks good. He won’t have to make the unpopular decision to raise taxes or cut spending. His city budget? Never better.

Now, perhaps all will be fine. Maybe the economy will bounce back quickly. Maybe the city of Long Beach won’t get too greedy and will allow the port to keep money enough to boldly invest in itself. Maybe only a few shippers will decide to sail off to Houston or someplace else.

But maybe not. Maybe the port will fall behind. At worst – but by no means far-fetched – the L.A. and Long Beach port complex may devolve from America’s main point of entry for foreign goods down to a boutique port that serves Southern California. If that happens, expect to see empty slips and eventually derelict wharves, about as useful as the Packard plant in Detroit. Expect to see L.A.’s many businesses and industries that depend on the port complex to shrink.

And if that happens, we’ll know to thank Mayors Villaraigosa and Foster.