The demand came in a resolution voted on Thursday in Strasbourg.
The vote coincides with the International Day to End Immunity for Crimes against Journalists.
Since the failed coup on 15 July, the Turkish government has arrested at least 99 journalists and writers, revoked the press credentials of at least 330 journalists, and closed the offices of more than 100 media outlets, leaving over 2300 media workers without jobs.
The resolution reads, "Journalists should not be detained on the basis of the content of their journalism or alleged affiliations."
The text calls on the Turkish authorities to "release those journalists and media workers being held without compelling evidence of criminal activity."
In a debate in Parliament on Thursday, MEPs were told that since the coup, at least 99 journalists and writers have been arrested, denied the right of access to a lawyer and kept in inhumane conditions in which they are threatened and mistreated.
The European Federation of Journalists and the Turkish Journalists' Association also said the offices of more than 100 broadcasters, newspapers, magazines, publishers and distribution companies had closed, leaving over 2300 journalists and media workers without jobs.
MEPs said the botched coup "cannot be used as an excuse to further stifle legitimate and peaceful opposition and to prevent journalists from exercising their freedom of expression."
"A free and pluralistic press is an essential component of any democracy" and open society, the resolution states.
Turkey's government should "narrow the scope of the emergency measures, so that they can no longer be used to curtail freedom of expression" and not use the "broadly defined Turkish anti-terrorism legislation" to punish journalists, MEPs said.
They called on the European External Action Service (EEAS) and member states to closely monitor the practical implications of the state of emergency declared following the coup attempt.
Meanwhile, an event in Brussels on Thursday heard that more needs to be done to protect journalists worldwide.
Adeline Hulin, of UNESCO, said that in the past decade, 827 journalists had been killed in the course of their work, 213 in 2014-15 alone.
Some 59 per cent of these were killed in conflict zone but in only eight per cent of cases were their killers brought to justice, she said.
Former BBC journalist William Horsley, of the Association of European Journalists which organised the hearing, described the figures as "very dramatic" but said one problem was the "cynical and neglectful" attitude of media outlets themselves.
He said, "All too often, journalists go into war zones with a bit of a buccaneering attitude."
Horsley said the threat to journalists' safety posed an "existential threat" to society.