Chanting anti-Islamist slogans and waving Turkish flags, the crowd called on the pro-Islamic government to resign, as they marched through the capital Ankara.
"Turkey is secular, it will remain secular," "Down with Sharia law," "Mullahs, go to Iran," protestors shouted.
Turkish Prime Minister Tayyip Erdogan has called for national unity.
"The finest answer that can be given (to the attack) is to maintain our unity in keeping hold of our republican values above all parties," he said, speaking at a ceremony in Antalya in southern Turkey.
Deepening rift
A 29-year-old gunman shouting "I am a soldier of Allah" stormed the country's top administrative court and sprayed gunfire in a meeting room.
Judge Mustafa Yucel Ozbilgin, 64, died after six hours on the operating table, and four other judges were wounded.
The attack underscores a deepening rift between the secularist establishment -- including the courts and the military --and the Islamist-rooted government, which is often accused of trying to reinforce the role of religion in politics and daily life in secular Turkey.
The gunman, Istanbul lawyer lparslan Arslan, was arrested after the attack.
He said he wanted to "punish" the Council for a February ruling that upheld a ban on women wearing the Islamic headscarf in public institutions and universities, court officials said.
The government of Prime Minister Erdogan, which has religious roots, has been campaigning for the regulations to be wound down, often criticising court decisions upholding the ban.
But it is now coming under fire for those comments, accused of emboldening anti-secular extremists.
Anger simmered at the judge's funeral, where protestors booed government ministers and hurled plastic bottles at them.
They also called Prime Minister Erdogan "a murderer."
Media reports said Deputy Prime Minister Abdullatif Sener was punched in the shoulders and escorted to safety by policemen forming a human chain around him.
The secularist establishment, including the powerful army, sees the headscarf as a symbol of Islamic militancy.
"Martyr"
The crowd cheered military officers attending the funeral, in a reminder of 1997's military coup, when the army forced Turkey's first Islamist-led government to resign.
Mr Erdogan's Justice and Devlopment Party (AKP) is an offshoot of the ousted and now-banned party, but has disowned its origins, describing itself as simply "conservative."
Earlier, around 25,000 people marched to the mausoleum of Mustafa Kemal Ataturk, the founder of modern, secular Turkey, led by the president of the Council of State, Sumru Cortoglu, and other senior jurists.
"Today we're sending a martyr to eternal life," Sumru Cortoglu told mourners, speaking of Justice Ozbilgin.
Anti-terrorism police have detained five other men believed to have ties to the gunman, police sources told the Anatolia news agency.
Mr Arslan, who was questioned throughout the night, insisted he acted alone and had no links to any extremist group, Anatolia reported.
President Ahmet Necdet Sezer, a staunch secularist who has often clashed with the AKP and blocked a series of government bills he deemed pro-Islamic, described the attack as "a black stain" on Turkish history and issued a veiled warning to the government.
The government condemned the attack, but denounced any link between the shooting and its as yet unsuccessful campaign to lift the headscarf ban, which it says is a breach of human rights.
