The word bee, as used in spelling bee, is one of those language puzzles that has never been satisfactorily accounted for. The earliest known example in print is a spinning bee, in 1769.
Spelling bee is apparently an American term.
It first appeared in print in 1875, but it seems certain that the word was used orally for several years before that. Those who used the word, including most early students of language, assumed that it was the same word as referred to the insect. They thought that this particular meaning had probably been inspired by the obvious similarity between these human gatherings and the industrious, social nature of a beehive. But in recent years scholars have rejected this explanation, suggesting instead that this bee is a completely different word. Bee may simply be a shortened form of been, but no one is entirely certain.