There are a number of reasons for this, but what it boils down to is strengths and weaknesses. Aspies are by nature very poor at the basic skills required for socializing (false emoting, complex emotions, quickly processing multi-layered communication, and so on), and with a herculean effort of red pill study, practice, insight, and willpower can only raise these weak areas to average levels. However, we have an extraordinary advantage in the area of humor. There are three factors that play into this.
1) We automatically have an outsider’s perspective when observing social minutiae, which means we don’t need to look for the absurdity of it. The absurdity is constantly staring us in the face. Neurotypicals see and feel this absurdity, but they don’t allow themselves to talk about it.
2) We have much wider associative horizons, which is essential to forming new jokes rather than rehashing old ones. We are simply better at being intellectually playful (ref: the Internet). So we might not have the social cache to abuse a room of people and force them to laugh about it, but with a little practice we can come up with ten times as many jokes per hour as neurotypical comedians. Unfortunately this is probably not true for our high-functioning autistic cousins or people with such extreme IQs that basic communication with others requires philological analysis.
3) Humor is the closest thing to intellectual seriousness that is allowed in polite company. Generally, when aspies socialize we want to exercise our brains a bit. You have to make a serious study of how appropriateness works, but once you do you’d be surprised at what you can get away with talking about. The court jester archetype is embedded deeply into white culture, and everybody knows that the fool is the only one allowed to criticize the king. If a clown shoved a pie in the president’s face the onus would be on the president to respond without anger (which would show weakness, traditionally). Depending on the president’s temperament people might question whether the clown was stupid to take such a risk, but in the Anglosphere no one would question whether he had the right to do it. Unfortunately, this probably means it won’t work in other cultures. Also unfortunate is the requirement for brevity- it is considered bad form to stay on topic or speak at length.
I may or may not try to come up with theories about how humor works and how to get better at it, but it is probably important enough that you should try to figure it out for yourself as an experiential matter of study like personal diet, religion, or psychology. Ultimately it’s gonna come down to practice and figuring out what works for you.