When armies took prisoners in southern Europe in the middle ages, they would sometimes be offered the chance to earn their freedom by eating a fig from a mules anus. As the captors taunted their captive, offering him this degrading method of escape, they would bite their thumbs.
I bite my thumb at thou! infidel!
The grammatically correct way that Shakespeare would say "I bite my thumb at thou!" since everything has to be grammatically correct...
(An insult used in Shakespeare)
I bite my thumb at thee!
As has been noted before, it has been used by Shakespeare.
A qualified guess is that the phrase, (and the hand gesture that accompanies it), symbolizes oral sex,
and implies that the insulted is gay.
Shakespeare - "Romeo and Juliet"
a vaginal cream using in the "love-making" process