We had purple beans for dinner, from farmer's market. I heated some olive oil in a pan and cooked them through until they had turned all green, and then salted them a little at the end.
The recipe called for adding chopped almonds but it didn't happen; instead I served the boys tofu that I had cut into cubes and boiled (boiling it improves the texture quite a bit, firming it up more to my liking).
I don't know which variety of purple beans we had. A search of the net unearthed the "romano purpiat bean" (from Territorial Seed)
Why are beans purple? Good question. I got as far as finding this:
Genetics of flower and pod color in Phaseolus vulgaris
© 1984 The American Genetic Association 75:440-444
A new locus, Prp (purple pod), having five alleles affecting anthocyanin pigmentation of corolla and pod, is described in Phaseolus vulgaris L. The allele Prp produces dark-purple corolla and is fully dominant in this respect over the other four alleles that determine light-purple corolla. In the absence of Ro, Prp is responsible for medium-purple pod when homozygous and light-purple pods in combination with the other alleles. The alleles prpsh2 and prpsh give green pods shaded with purple and are codominant with the prpst allele, which causes green pods to be striped with purple. These four alleles are dominant for pod color over prp, an allele causing green pods when homozygous. The interaction of these alleles with the genes Gri, V, and Ro, which also affect anthocyanin pigmentation of corolla and pod, is described. No linkages among these four loci were observed.
That's from 1984; I don't know enough about bean genetics to go any further.
(Oh, and they are delicious.)