The origin of the word appears to go back to the Greek, 'sarkasmos' from 'from 'sarkazein' to tear flesh. The origin of the concept may go further back.
I often wonder if the first sarcastic person may have been burned as a witch.
Here is a paper that, humorously enough, discusses the contradictory thought about sarcasm.