The organisers Pink Life QueerFest Four had planned to screen four films at cinemas on 16 and 17 November.
They said the decision "deprives us of our constitutional rights".
Homosexuality is not illegal in Turkey but activists say homophobia remains widespread.
In a statement, Ankara's governor office said the festival's content "could incite grudges and enmity toward a part of society".
Intelligence suggested that "terror organizations are seeking to attack dissident groups or individuals" and that the "screening could be provocative and draw reactions", it added.
The event's organisers said the festival had already been attacked on social media before it was banned.
"Suggesting that these screenings could be provocative or targeted by terror groups only goes to legitimise those people and institutions that produce hate speech toward us and see our existence as a threat," they said in a statement.
The event was backed by the German embassy, AFP news agency said.
The cancellation comes amid deteriorating relations between the two countries sparked by the detention of German nationals and what Turkey says it is Germany's interference in domestic issues.
LGBT groups have complained that their rights are being curtailed under the government of President Recep Tayyip Erdogan and his Justice and Development Party (AKP), which is rooted in conservative Islam.
They say they are frequently targeted with animosity, harassment and abuse and that authorities have failed to uphold their rights.
In Istanbul, the annual gay pride parade, once a popular event, has been banned for three years in a row.