Beans were anciently used in casting votes by balloting, the white beans for affirmative and the black ones negative. When Pythagoras said to his disciples, "Abstain from beans," he had no reference to them as an article of diet, for he ate them himself. What he did mean, and what his immediate followers already understood, was that they should abstain from the intrigues of politics as being antagonistic to a philosopher's pursuits.
It also couched a warning of the danger of criticising the popular government.
—HL Sumner, "The Beans of Pythagoras" The Path – February 1888
I defer to Gareth Rees much elaborated, well-sourced answer. I'm not sure how I found the above quote, but the Theosophical Society is an embarrassingly terrible source.