I'm afraid it rarely helps to ask "why" questions. I think your question is legitimate, because "vegetables" is different from other logically similar words. I'm not sure there's any definitive answer, and I can't think of any memory trick to remember which is which.
I can imagine my wife sending me to the grocery store and saying any of these things, and I can't point to any obvious logical differences:
"We need to get some groceries."
"We need to get some fruit."
"We need to get some vegetables."
"We need to get some meat."
"We need to get some apples."
"We need to get some chicken."
"We need to get hamburger, so that I can make hamburgers."
It is possible for the same word to exist both as an uncountable and as a countable noun. The countable form refers to kinds or types or categories. For example, "meat" is usually an uncountable noun. "My friend won't each meat, she only eats vegetables." But you could say "the supermarket has a good selection of meats, including beef, pork, lamb, chicken, and turkey."
Similarly:
"We don't have any cereal in the house. Get some cereal.
"What kind?"
"My favorite cereals are cornflakes and granola."
I'm going to try for a logical answer, but I'm just making this up and I can't be sure it's true.
I think "vegetables" is almost always countable because we almost always use the word to mean a category or kind of food. If my plate has fifty peas and two potatoes on it, I say "I have two vegetables," not "I have fifty-two vegetables."
"Vegetable" can be used without an "s" as an adjective. In that use, it doesn't mean "one," it almost feels uncountable to me: "They have carrots and celery in the vegetable section." "Some parts of the world subsist mainly on a vegetable diet."