The London quarterly review dated 1837 states "Formerly, in Cornwall, when the master of a family died, the bees were put in mourning by hanging a piece of crape or black cloth upon the hives ; otherwise it was believed that the bees would die, or forsake the place. An opposite superstition prevailed in Cumberland: there, upon the master's death, the bees were immediately destroyed. Yet in both counties bees were once regarded as things too sacred to be sold, and honey was to be obtained only as a gift, not by purchase."
"If a bee keeper died, his widow or nearest relative went out to tell the insects that their master was dead. Black cloth was sometimes draped round the hives so bees could take part in the mourning. At Eyam it was usual for bees to be given morsels of the funeral meal."
As far as I can discover this custom was common in both England and New England in America, brought from the Old Country, and supposed to prevent the bees from leaving their hives and seeking a new home.
Telling the Bees, a poem by Whittier was published in 1858 speaks of a man passing by the farm of his beloved, where he sees the chore girl dressing the hives in mourning and informing the bees of a death. He thinks his Mary's grandfather has died, but is stunned to hear the girl tell the bees “Mistress Mary is dead and gone!”
Full poem at John Greenleaf Whittier