If we pay more careful attention, we will see that the word ליצנות is always used in a negative context, and that it is always אסור, with the exception mentioned in Shas of ליצנותא דעבודה זרה. As mentioned in the above comments, the degrading of evil is a positive thing. Anything else is a bad midoh. We are instructed many times to avoid it.
In contrast, the gemora extols the virtues of מילתא דבדיחותא, with references to being an appetizer for learning, and creating שמחה. There are פסוקים to the effect of כל השומע יצחק לי and the like that are quited to support the virtue of being in a happy mood and laughing. The laugh at the expense of another is ליצנות, and it is a pretty awful thing.
To be specific about the question of the heading on this thread, ליצנות is always bad, except for ליצנותא דעבודה זרה (and whatever is included in that). בדיחה is a positive virtue.