Technically, beans are neither a fruit nor a vegetable. Beans are classified as legumes, a type of plant that produces edible fruits and seeds.
The word legume refers to the actual plant and the plant's fruit as well as its seed, which can be confusing. A good rule of thumb is that the long, thin pod is the fruit of the legume, while the small round ball contained inside is its seed. Snow peas, string beans, sugar snap peas, green peas, kidney beans, black beans, chickpeas and fava beans are all types of legumes.
To further complicate matters, the USDA groups foods according to their nutritional content and has stated that beans and peas are unique foods that can be considered either vegetables or protein sources.
However they're labeled, legumes are a healthy, low-fat way to add protein and fiber to a diet and are popular additions to vegetarian dishes for that very reason.