The Abbott government really has got itself into a tangle over freedom-of-speech issues.

It came to office in 2013 on a mission to emasculate Section 18C of the Racial Discrimination Act – the section dealing with harmful speech – on the grounds that it burdened freedom of expression. Now it is attacking the ABC for allowing a person to broadcast his own particular brand of harmful speech on ABC TV’s Q&A program.

So where does the government stand on harmful speech?

Attorney-General George Brandis, arguing in support of his attempted amendments to the Racial Discrimination Act, asserted that everyone is entitled to be a bigot. Is Zaky Mallah, from Q&A, entitled to be a bigot? If he is, why is the government now assailing the ABC for allowing him a platform on national television?

Prime Minister Tony Abbott’s reaction to the broadcast offers a clue. He asked of the ABC:

Whose side are you on?

It seems reasonable to infer, then, that in Abbott’s worldview, a person’s freedom of speech depends whose side they are on.

However, in all the politicking, the free speech debate has become confused. We need to return to core principles:

Freedom of speech is a fundamental civil and political right essential to the functioning of a democracy.

It is not an absolute right, and sometimes gives way to other interests.

It gives way when it does unjustified harm to those other interests.

In a democratic society, people are free to speak without prior restraint, but must take the consequences if the speech does unjustified harm and cannot be defended either ethically or legally.

For Monday night’s Q&A, the program’s producers invited Mallah to be part of the audience and accepted him as an interlocutor with the panel. It is clear from what the presenter, Tony Jones, said on air that the producers were well aware of Mallah’s criminal record.

Relevantly, Mallah had pleaded guilty to threatening to kill ASIO officials. He had been acquitted of charges relating to the planning of a terrorist attack in Sydney.

On the agenda for the program was the issue of the federal government’s proposed laws to strip dual nationals of their Australian citizenship if they had been involved with terrorist organisations. It was in this context that Mallah became engaged in a discussion with Steven Ciobo, parliamentary secretary to the foreign minister, who was on the Q&A panel.

Early in the piece, Ciobo said to Mallah:

I’m happy to look you straight in the eye and say that I would be pleased to be part of a government that would say you’re out of the country.

After a period in which other panellists debated the citizenship question more broadly, Mallah responded:

The Liberals now have just justified to many Australian Muslims in the community tonight to leave and go to Syria and join ISIL because of ministers like him.

This was the statement that caused the subsequent outrage. But it is a statement that can be construed in two ways.

It can be construed as meaning that by alienating Muslim people – in Mallah’s case by saying he was a person Chiobo would be pleased to deport – the government is only making matters worse. That is a reasonable proposition.

But it can also be construed as encouraging participation in Islamic State by offering a justification for doing so. That is irresponsible and against the public interest. It can also be construed as propaganda.

This is where the problem arises for the ABC. It is a primarily a problem of editorial judgement, not of free speech. Mallah has enjoyed his freedom of speech, assisted by the ABC, and now both are taking the consequences.

The program producers’ editorial judgement that Mallah should be afforded a platform was flawed for three reasons.

First, given his known record and the ultimately open-ended nature of the Q&A format, it was reckless to select Mallah as an interlocutor because it was reasonably foreseeable that he would say something irresponsible.

Second, there is an ethical duty on the media to provide a range of opinions on controversial issues, but not to provide opportunities for propagandising. Given Mallah’s history, it was reasonably foreseeable that he would propagandise.

Third, a person of standing in the Muslim community could have been invited to participate in the program. It was not necessary to rely on such a risky source in order to include the Muslim perspective.

There were non-editorial issues as well concerning security at the studio and what precautions were or were not taken in light of Mallah’s record.

The ABC has admitted it made mistakes, and there is to be an inquiry. But in the super-charged political environment in which this will take place, it is important not to conflate lapses of editorial judgement with broader free speech issues. The key issue here is editorial responsibility.