The government finds itself in an unusual position. The party that ran a hysterical campaign against the carbon price — alternately a “cobra strike” or “python squeeze” that would, famously, wipe out Whyalla, cause massive economic dislocation and job losses and lead to $100 legs of lamb — is complaining about a hysterical campaign against it by the union movement over the so-called China-Australia Free Trade Agreement.

The government has labelled the union campaign against the provisions of the preferential trade agreement relating to large infrastructure projects — which unions say will mean projects with even relatively small levels of Chinese investment will be able to bring Chinese workers in without checking whether Australians workers can do the work — as “racist” and “xenophobic”. This week the Prime Minister accused Opposition Leader Bill Shorten of being “silent in the face of racism”. For good measure, Julie Bishop accused Labor of “economic treason”.

The union campaign is plainly getting traction in the community, with Coalition MPs complaining about it at this week’s joint party room meeting and Trade Minister Andrew Robb promising an advertising campaign to combat it.

There’s a grain of truth to the union campaign, as the ABC Fact Check analysis showed — the process for approving Chinese-funded infrastructure projects worth more than $150 million includes a new mechanism for bringing in low-skilled workers without a mandated process of labour market testing, which is required for 457 visas. Labour market testing is purely optional for such projects. But as one observer pointed out to the ABC, any Chinese workers will have to be employed at the same wages and conditions as Australian workers, rather undermining the incentive to rely on imported labour for projects. That said, sham contracting arrangements — rife within the construction industry — could be used to get around that problem. Foreign workers in construction tend to feature disproportionately as “independent contractors”.

The government’s problem is that it has little credibility when it comes to charging others with exploiting racism and xenophobia. For many months, Joe Hockey has been running a blatantly xenophobic campaign about foreign real estate investment. Just this morning, Hockey introduced amendments to the Foreign Acquisitions and Takeovers Act into Parliament aimed at cracking down on foreign real estate buyers. This campaign, along with some downright racist media coverage of the issue, has started to create a hostile environment for anyone of Asian appearance, no matter their background, at real estate auctions. As Michael Pascoe correctly pointed out, chasing a handful of foreign real estate investors out of the market is no substitute for actually addressing the real causes of housing unaffordability, which might entail some political risk. Indeed, there’s a good chance the campaign and the hostile environment it has engendered will curb foreign housing investment where we want it to go — into new housing stock.

Hockey’s amendments will also impose more red tape on the framework for foreign investment in Australia’s enormously successful and highly productive agricultural industry. Not that he calls it red tape — rather, Hockey says it is “providing greater certainty for investors”. This “greater certainty” is at the behest of the Nationals, who are generally opposed to the transition of agriculture into a modern industry rather than a sector of family farmers, and Barnaby Joyce in particular, who has called for an outright ban on Chinese state-owned enterprise investment in the sector.

Joyce isn’t alone in complaining about foreign investment in agriculture. Radio entertainer Alan Jones is a long-term critic of Chinese investment, and he took Andrew Robb to task recently on the issue. To his credit, Robb hit back at Jones and called his claims racist. “Let me take you back 100 years,” Robb said, “Vestey’s [the British pastoral empire] owned all of the north, they couldn’t take it away.” He went on to deliver a succinct defence of foreign investment of the kind too few politicians are prepared to deliver.

“We get the taxes from it, we get the jobs from it, we get the infrastructure from it. We get the capital coming into Australia; we are a capital limited country. We are a great country and we’ve got enormous resources, but we have needed for 200 years other people’s capital to develop those resources, and we’ve still got thin capital markets and we still need other people’s capital to come and develop those resources.”

Labor itself is hardly pure on the issue. Unions in NSW during the March state election campaign, with the support of NSW Labor, also ran hard on the issue of foreigners buying NSW electricity assets if they Mike Baird privatised them.

But despite Robb’s good words, the Coalition’s position is: Chinese labour good, Chinese investment bad, especially in real estate and agriculture, where for political purposes the Liberals are prepared to truckle to the most base instincts of their National colleagues and the wider electorate.