It's called dark humor. Tragic events can be respected and grasped without some puritanical concept of them being "untouchable" subjects. A joke about 9/11 is almost certainly taking advantage of (and probably directly in opposition to) the exact attitude that lead to it becoming "off-limits" in the first place, and playing with it.