But... legumes and vegetables and beans are not mutually exclusive. Look up the definition of "legume" and you find "legume is a vegetable used for food, or the fruit or seed of plants know as legumes such as peas or beans." Or the longer version says "1a: the fruit or seed of plants of the legume family (as peas or beans) used for food. 1b : a vegetable used for food
2 : any of a large family (Leguminosae syn. Fabaceae, the legume family) of dicotyledonous herbs, shrubs, and trees having fruits that are legumes (sense 3) or loments, bearing nodules on the roots that contain nitrogen-fixing bacteria, and including important food and forage plants (as peas, beans, or clovers)
3 : a dry dehiscent one-celled fruit developed from a simple superior ovary and usually dehiscing into two valves with the seeds attached to the ventral suture : pod"
So in the same way that we consider peas to be "vegetables", I think it could be reasonable to call legumes like lentils vegetables as well as beans. I don't think grain fits it though, that I can see (thanks again to Merriam Webster, grains have to be fruit/seed from a cereal grass)
Not sure if this is self-serving research though, since I want to be able to click extra fruits and veggies in my tracker when I eat lentil soup, which is every day now :)