Chocolate is made from a cocoa bean. What keeps that bean from being considered kitniyos?
Just because the English word is 'bean' does not mean that it is kitniyos. A good explanation can be found at What is Kitniyot?
Here is the initial summary of that article. You can read the details there.
There were briefly those who'd heard of this thing called coffee -- it's a "bean", you grind it -- who wondered if it were kitniyot.
This was quickly rejected, I don't recall who it was who'd said "if you ever saw a coffee plant, you'd understand why it's not kitniyos."
Very simply -- all kitniyos, like the 5 grains, are annuals. Coffee and chocolate are perennials.