All animals have microbes in the gut. Some animals have dozens of different bacteria, but others have only a few. The typical honey bee adult worker has in its gut about 1 billion bacteria but only 8 types. These bacteria are mostly unique to bees and not found in other animals. The largest numbers are in the hindgut. Few are found in the midgut and crop.
What function do they have? In most animals they can provide metabolic supplements and protection against pathogens. Bacteria can secrete substances with antimicrobial properties that exclude other potentially pathogenic bacteria. Many possible functions have not yet been elucidate for bees.
Nancy A Moran. Genomics of the honey bee microbiome. Current Opinion in Insect Science
Volume 10, August 2015, Pages 22–28.