Erdogan was losing ground in the polls of a referendum, in which his power is at stake. Erdogan is looking for votes of Turkish citizens that live abroad - and who are quite often also citizen of the country they live in. Western countries and organizations like Amnesty International have been raising concern that Erdogan is 'anti-democratic'.
Turkish foreign minister Cavusoglu campaigned in Rotterdam just two years ago - permitted by Dutch government. Apparantly, the values of freedom of speech and freedom of association were seen as important at the time. Those values are quite absent in public statements by Dutch government officials about the current diplomatic crisis with Turkey. Now, there is emphasis on 'we are not comfortable with allowing a dictator to promote himself on our territory'.
Dutch elections are this March, the 15th. There was electoral pressure from anti-Islam and anti-immigration politician Geert Wilders' popularity in the polls on Mark Rutte (the prime minister and leader of a conservative party that is in competition with Geert Wilders) to appear tough and powerful facing the Turkish government.
The Dutch government used 'safeguarding public order and safety' as official argument to, at first, advise against and later block the Turkish government officials from entering the country. However, the Dutch government didn't make clear how the concern for public order and safety was legitimate. If the Dutch government had allowed the Turkish ministers to campaign, Turkish-Dutch citizens would have had no reason to protest for Erdogan versus the Dutch government. The now occured riots are a self-fulfilling prophecy. Turkish people were triggered by (social) media attention to the conflict between Turkey and the Netherlands. Erdogan cum suis have activated Turkish people to protest. If the Dutch government had allowed the campaigning in the first place, people with both the Turkish and Dutch nationality would not have had to choose between both governments.
During negotiations between the governments of Turkey and the Netherlands about the alien campaigning, Turkish government officials made public threats to put pressure on the Netherlands. For a Machiavellian like Erdogan, it is not too far fetched to think he was playing with the idea to provoke the Netherlands into tough play. Anyway, the Dutch government now had the argument 'Turkey has forced our hand by threatening us'.
The European Convention on Human Rights (article 16) allows sovereign states to forbid alien political campaigning. So, legally, the Netherlands has the right to act as it has done. But the real question should be: is it smart? Erdogan is the true Machiavellian in this case; his popularity amongst Turkish citizens is rising as a result of the conflict with the Netherlands - he is even supported by political opponents. And while 'the Netherlands are fascist and Nazi's' is an accusation made by Erdogan that doesn't have merit, he has a point that the Dutch government didn't favor freedom of speech and freedom of association over political powerplay.
Turkish law on elections forbids political campainging in foreign countries. This law was established by Erdogan's party. The irony.
A Turkish diplomat lied to the Major of Rotterdam, Ahmed Aboutaleb, about the intentions of Turkish government officials, so it was a surprise to the Dutch that the Turkish minister of family affairs went to Rotterdam.
Some Dutch citizens threw objects towards the Turkish protesters. I don't know if this happened before or after the Turkish protesters threw objects towards Dutch policemen.
In short, it seems electoral gains at both sides have been important incentives for a power play that does not benefit citizens of both countries.