Hate speech laws in Germany are very clear, it's about how this hate is expressed in a public fashion (specifically incitement). German politicians and lawmakers see social media as "public".
To expand on this, in Germany it is prohibited to incite hatred towards a group in a public nature that rallies/incites the public and spreads this hatred, disturbing the "societal peace" of the nation/national unity. This hatred encompasses verbal abuse that affects their dignity, physical abuse, etc.
To put in context with Facebook, say a bunch of people having some neo-nazi group spreading hateful things, people joining it, spreading it to their friends, group is filled with spreading Islamaphobia, homophobia, anti-semitism, spreading that "there should be a holocaust 2.0 against Muslims in Europe" - this is not see any different than if these people were doing this on the streets of Berlin. Facebook is seen as "public" in the same manner. It is why it would also be impossible for people like the Westboro Baptist Church to operate in Germany.
Germany is not the only country with these sort of laws, Sweden, UK, etc have them too.
Hate speech laws don't stop you from being racist or having an opinion of something or whatever, you can express that opinion, but there are many ways you can express it... and some of these ways are not accepted, especially the ones that incite mass hatred, incite physical assault, etc.
To use an example, in the U.S there are people that call for community members to patrol their communities and "protect" it from Muslims, and actually doing it (with guns no less). This would be considered hate speech in Germany, the both calling/spreading of this, plus actually doing it.