You laugh because you're surprised by your own joke. It's like when someone gives you a present, and you think it's just okay, but then you realize how thoughtful it was. Your brain is tricked into thinking the joke is even funnier than it actually is, so you laugh harder at yourself.