It should be noted that a vegetarian, or vegan, diet isn't only vegetables. They include fruits, grains, legumes, nuts, roots, tubers, and berries too. The point of a vegetarian diet is to not eat meat, but often allows for some animal products, like eggs and milk. Some modify the diet to allow for fish, and/or poultry. One of the reasons for this is that meats, especially red meats and pork, are linked as contributing factors to some kinds of health issues. A vegan diet is one that forbids all meat and animal products, which means no milk, eggs, animal fats, and etc in their diets.
A strictly vegetable diet can potentially lead to malnutrition. This is due to the fact many vegetables not carrying enough fats, especially saturated fats which are necessary. Many types of vegetables also lack, or are low in essential vitamins and minerals. Most of all it's hard to get enough protein with vegetables alone. Which is why most vegan and vegetarian diets include fruits, grains, legumes, roots, tubers, nuts, and berries. As those help cover all of a person's dietary needs.
In all honesty there isn't conclusive evidence that these diets are actually better. One of the biggest contributing factors in obesity is actually people eating too many carbohydrates, which be tend to store as fat. Properly done however a vegan or vegetarian diet can be balanced not to have those problems.
The thing is that these sorts of diets are kind of a failure because they favor extremes. Which means they tend to be the antithesis of moderation and self control.