Not the OP, but I'm German and I didn't find the poem funny. That wasn't the point of the poem. The poem wasn't the comedy. The comedy was the presentation of the poem.
Saying Erdogan has sex with goats isn't funny. It's crude and it's even potentially racist (considering that sounds more like an ethnic slur than a personal insult). But that was the entire point. The poem actually went out of its way to be so appallingly insulting to drive this point home.
I don't think the performance was particularly good and I think the same point could have been made in a more tasteful way, but it should be protected as satire and I hope the German courts will rule accordingly (as many lawyers are predicting).
The entire point of the performance was a reaction to the ridiculous complaints about the earlier satirical song about Erdogan (which btw was almost entirely factual and only "insulting" because it presented Erdogan unfavourably and ridiculed his eccentricity and blatantly autocratic behaviour). It didn't set out to insult Erdogan, it was explicitly phrased as "That wasn't an insult that is illegal under German law. The following is what an insult that would be illegal under German law would look like".
Taking the poem in isolation is intellectually lazy and dishonest. It's like showcasing a replica of Michelangelo's David's penis and saying David is obscene because it's entirely about genitalia.