He made the comments at a news briefing in his home city, Davao, on Tuesday, where he also unveiled his new cabinet.
Since 1986, 176 journalists have been killed in the Philippines, one of the most dangerous countries for reporters.
But Mr Duterte said many of them had "done something wrong".
The former mayor of Davao was formally declared the next leader on Monday, after a landslide victory in May's election. He will be sworn in on 30 June.
When asked about the high number of attacks on journalists, Mr Duterte said that "you won't be killed if you don't do anything wrong".
Citing Jun Pala, a journalist, politician and critic of Duterte who was murdered in 2003, he said: "I do not want to diminish his memory but he was a rotten son of a bitch. He deserved it."
"That can't be just freedom of speech. The constitution can no longer help you if you disrespect a person."
The National Union of Journalists of the Philippines said the comments were "appalling".
"Mr Duterte's crass pronouncement not only sullies the names and memories of all 176 of our colleagues who have been murdered since 1986, he has also, in effect, declared open season to silence the media."
The US-based Committee to Protect Journalists (CPJ) said the remarks "give security officials the right to kill for acts that they consider defamation".
"This is one of the most outrageous statements we have ever heard from a president in the Philippines," said CPJ's Shawn Crispin in Bangkok.
The news conference was a typically strident appearance by the man nicknamed "The Punisher" for his strict criminal policies in Davao.
Here are some of the other main points:
Mr Duterte's popularity rests on his reputation as a crime-fighter.
During his time as mayor of Davao crime fell sharply, but it also saw the rise of death squads and, according to rights-groups, at least tacit official approval of the murder of more than 1,000 people.
Saying the new crackdown started "now", Mr Duterte promised to pay 3m pesos ($64,000; Â£44,000) to officials who capture suspected drug lords,
If any law enforcement agent was "messing around with drugs and it comes to a fight, I want you to kill him personally", he said.
Mr Duterte's new cabinet is mostly male - only two so far are women - and they were broadly seen as conservative choices.
Perfecto Yasay, who has said talks are the only way to resolve the country's South China Sea disputes, was named foreign secretary.
Mr Duterte's former schoolmate, Carlos Dominguez, was named finance minister, and economics professor Ernesto Pernia will be economic planning minister.
More controversially, former marine Nicanor Faeldon was chosen to be head of the customs bureau.
He led a coup attempt in 2003 and in December took a group of protesters to a disputed island held by the Philippines, to a furious response from Beijing.
"We have this pact with the West, but I want everybody to know that we will be charting a course of our own."
Currently a staunch ally of the US and recipient of its protection, if not formal backing, in territorial disputes with China, Mr Duterte said the Philippines would no longer rely as much on Washington.
The US State Department responded by saying it had "no problem whatsoever" with bilateral talks among parties to South China Sea disputes, but that most would not be solved that way.
Mr Duterte said he was waiting for the results of the case The Philippines has before the Permanent Court of Arbitration in The Hague, over disputed islands in the South China Sea.
"Then, with the advice of the cabinet, I might be able to proceed," he said. "But you know, I am not ready to go to war. It will just result in a massacre."
Philippine President-elect Rodrigo Duterte has been condemned by media groups for saying some of the many journalists killed in the country had deserved to die.