Free speech has boundaries. We have to figure those out as a society. The Mohammed thing ethically was used to prove a point that not everyone in the world needs to adhere to the tenets of one religion. It was not antisocial behaviour, used to damage the functioning of society. The second one is to prevent the influence of lies and propaganda from damaging society. That's the point of laws, really; to set down in paper a system of rules for ensuring that society functions. There may be a legal squabble, although these were two different countries, but ethically it seems clear to me.
If I convince a group of people to undeservingly hate a particular group, and then some of those people discriminate, kill or otherwise harm the group, am I doing something wrong?