Bone golems resemble undead, but the spirits that animate them are the elemental sparks that power constructs, not the malevolent or trapped souls that animate skeletons and the like.
Typically spellcasters craft bone golems out of convenience—bones are what they happen to have a surplus of on hand, compared to the expensive and bulky stones, rare woods, or sanctified earth that other golems demand. This also explains their role as tomb guardians—in urban areas there are always paupers going unburied and potter’s fields to rob; in more rural areas (or if the tomb must be kept secret) the workers who built the tomb often wind up providing one last service to their master.
But just because bone golems are constructs of convenience, that doesn't mean their deployment is haphazard. Spellcasters often pair them with actual undead to confuse would-be robbers and deplete their spells. Lords fearing betrayal take advantage of the golems’ bone prisons to capture assassins for questioning. Even some good-aligned churches occasionally employ the monstrosities, using the freely donated bodies of worshippers to create servitors that cage and subdue rather than kill…at least not immediately.
A bone golem haunts the buried halls of Glenmorgan College—the foul construct serving as just one more reminder of the spiritual pollution and decadence that caused the bardic college to be razed. Its many skulls have each been enchanted to sing one of the Thirteen Songs of Discord. Recovering these verses would constitute a musical treasure (of an admittedly dubious sort). Of course, one would have to subdue the golem first.
The bounty hunter Kreb Half-Foot has a bone golem sidekick, and takes full advantage of the construct’s bone prison ability to ensnare his prey. Supposedly at least some of the golem’s bones belong to a former partner, and the man’s wife will pay handsomely to have her husband’s body returned and Kreb taught a lesson.
A bone golem guards a desert tomb. But the golem’s “bones” are actually the fossilized cartilage and teeth of innumerable sharks…a clue that this desert was once a very different place.
—Pathfinder Bestiary 3 133
Being an old-school (Known World) D&D fan, I’m used to a very different bone golem: one with no magical bone prisons, but with four arms for wielding heavy swords, from the Expert Rules and the Rules Cyclopedia. 2e fans can find it as the skeletal golem in the Mystara Monstrous Compendium Appendix.