Chocolate contains oxalate — a naturally occurring compound in cocoa beans — which can inhibit the absorption of calcium. The jury is still out, however, on whether chocolate causes problems for healthy people who eat calcium-rich diets.
The concern about calcium absorption and bone health comes from a 2008 study. It found that older women who ate one or more servings of chocolate a day had lower bone density and less strength than did women who ate fewer servings of chocolate. Researchers believe this may be due to oxalate inhibiting calcium absorption — but it could also be due to the chocolate's sugar content, which may increase calcium excretion.
On the plus side, dark chocolate (or cocoa) contains flavonoids, which are thought to be beneficial to health. Further research is needed to fully determine the role chocolate plays in calcium balance and bone health.
In the meantime, if you get the daily recommended amounts of calcium and vitamin D from food or supplements, and practice weight-bearing exercise, eating chocolate in moderation is unlikely to adversely affect your bone health.