This is humor that, with an implicit "wink-wink," makes fun of itself. Kids laugh and adults laugh. The Simpsons uses this technique quite frequently.
For instance, in one episode, a friend of Bart's begins using dirty language. His parents recount the list of dirty words he's been using to Marge, Bart's mother, and declare that their son must have picked the words up from Bart. It's the only possible answer, they conclude, for their son couldn't have learned these words from TV. The joke, of course, is that we just saw the words used on TV. The Simpsons has always been filled with this kind of humor.
Another example from the same episode: Bart and his class are about to go on a field trip to a boring box factory. Bart deals with it by escaping into a daydream. But the only image he can conjure up is the fantasy of himself going to a box factory. He wakes up from his reverie, angry at television for destroying his imagination.