The newest Rolling Stone with the Simpson’s cover has an interview with Matt Groening and he relates the story behind the theme:
“I suggested John Zorn to do the main theme, but then I played some of his stuff for everybody on the staff and they couldn’t handle it. So I put on some Esquivel, and they said, “This is the worst @!#$ I’ve ever heard.” Which is when I went to Danny Elfman, who I knew from way back when I used to review his old band, the Mystic Knights of the Oingo Boingo.”