That's how societal norms are established. By ridiculing unacceptable or antisocietal behavior. How else would people learn the limits on what a society considers appropriate and normal?
How you handle the problem of crossdressing/transgenderism is to have it taught within schools as a deviant behavior and as a mental disorder, and that those who practice them should get help for their mental disorders.
Laughing at them wont suffice. In fact, it does very little in the long run, even if that was the intent of the Shrek2 producers, which I seriously doubt it was.