Some humorists poke fun by making good, solid stories that are enjoyable in their own right, but have another layer of comedy in light of another story or genre, which they cause us to reconsider.
Others set out to write a bad story on purpose, and then point out how bad the thing they made was, in- and outside the text in question.
Purposefully bad stories -- "troll fics" -- exist in pretty much every medium and genre, and most readers don't like them. That's unsurprising. They don't engage meaningfully with whatever they're trying to criticize, and it turns out that regardless of the author's intentions, bad stories are kind of bad.
Some say that My Immortal, the crown jewel of Harry Potter fanfiction, must be a troll fic. Some say that no one could possibly write that in seriousness. Some say that it can only be a joke that got out of hand, a satire, a mean-spirited prank against all of fanfic-kind.
As for me, I have my own theory.