Judges ruled that fears of violent reprisals against Sweden did not justify a ban.
In a separate development, five people were arrested over a suspected terrorist plot amid "calls for attacks" after a Quran was burnt in January.
The case had "links to violent Islamist extremism", police said.
At Nato's headquarters in Brussels, Swedish Foreign Minister Tobias Billstrom would not speculate on the impact of the court verdict.
He said his country "thinks freedom of expression is important" but said it was "inappropriate to carry out something similar to this Quran burning".
Turkey's condemnation of the Quran burning outside its embassy in Stockholm added to its grievances about Sweden's bid to join Nato.
Turkey and Hungary have not yet ratified Sweden's application.
They approved Finland's bid last month and it became Nato's 31st member on Tuesday.
As diplomats welcomed Finland, they called for Sweden to be admitted in time for a Nato leaders' summit in Vilnius in July.
The UK called for a "swift accession" for Sweden that Finland called its "next goal". Lithuania's Foreign Minister Gabrielius Landsbergis called on Turkey and Hungary to ensure they did not "spoil the Vilnius summit".
"Finland's membership is not complete without that of Sweden," Finnish President Sauli Niinisto said.
Turkey has demanded a tougher policy from Finland and Sweden towards Kurdish dissidents that Ankara regards as terrorists.
It said last month that Finland had taken "authentic and concrete steps" but that further talks were needed with Sweden.
Turkish President Recep Tayyip Erdogan said in January that Sweden could not be admitted "as long as you allow my holy book, the Quran, to be burnt and torn".
The burning of the Quran by far-right politician Rasmus Paludan led to international condemnation.
Police banned protests at the Turkish and Iraqi embassies, but the court struck down their orders on Tuesday.
The concerns raised by police were not "sufficiently concrete" to override the right to freedom of expression in Sweden, judges said.
The terrorism arrests arose from one of several investigations after anti-Swedish protests following the Quran burning, security police said.
Susanna Trehorning, a deputy counter-terrorism chief at Sweden's security police, said there had been calls for attacks on the country.
“The security police often need to intervene early to ward off a threat. We cannot wait for a crime to be completed before we act,” she said.
An attack on the country is not “immediately imminent”, police said.
Nato Secretary General Jens Stoltenberg told Sweden on Tuesday he would ensure it joins the alliance.
Finland and Sweden hoped to join simultaneously after applying after Russia began its invasion of Ukraine.
Moscow condemned Finland’s accession as an "assault" on its security and national interests.
"This forces us to take countermeasures ... in tactical and strategic terms," Kremlin spokesman Dmitry Peskov said.