Bernie Sanders, of all people, has union trouble — and it just goes to show how nasty organized labor can be.

The Vermont socialist senator made history by agreeing that his paid 2020 presidential campaign workers would be repped by a union, United Food and Commercial Workers Local 400, with all earning $15 an hour. But now the union complains some employees are getting less.

Worse, someone leaked the whole dispute to the Washington Post.

Worse yet, Sanders’ response could be a violation of US labor law, all on its own.

The union’s gripe centers on the fact that field organizers, the lowest-level workers, often put in 60 hours a week but get paid only for 40, since they’re on a flat salary. That drops their average minimum pay to less than $13 an hour.

“Many field staffers are barely managing to survive financially, which is severely impacting our team’s productivity and morale,” the union said in a draft letter to campaign manager Faiz Shakir. “Some field organizers have already left the campaign as a result.”

Ouch. So Sanders is down to march with McDonald’s employees demanding higher pay, and happy to slam Walmart execs for paying “starvation wages” — but the folks working for him are feeling “berned.”

The dispute began soon after the March deal that unionized the campaign. Shakir’s first offer, in mid-May, was to boost pay, but the union rejected that because it would’ve obliged these workers to pay more for their health insurance.

By July 11, workers by the hundreds were messaging Shakir to do better. Last week, the union demanded that he OK an even bigger raise, plus better benefits.

Leaking all this Bernie-embarrassing stuff to the press was a clear union bid to force the campaign’s hand. So much for gratitude.

Bernie was peeved. He told the Des Moines Register, “It does bother me that people are going outside of the process and going to the media.” More: “That is really not acceptable. It is really not what labor negotiations are about, and it’s improper.”

Oops: That caustic comment puts him on the verge of violating federal labor law by interfering with or retaliating against employees’ exercise of their rights.

The campaign’s immediate response, now that it’s all gone public, is to restrict the field workers from putting in more than 40 hours a week. Hmm: If it then brings on more unpaid volunteers to pick up the slack, that’s a different union grievance.

Get ready for more fun: After Sanders unionized, both Liz Warren and Julián Castro joined in. Please, please, please: Let us see a strike right before Super Tuesday.