Does the biological classification of food have a relation to taste?
Yes, they are certainly connected. But as with many connections in the real world, it is not a perfect +1 correlation. So, just because tomatoes and potatoes are related and they don't taste similar, it doesn't mean that no two related plants taste similar, or that similar taste in related plants is due to random chance. 

First, many people talk about "taste" as if it were one thing. In fact, there are lots of things which contribute to taste. It can be roughly divided into a combination of four factors: the combination of the basic five tastes (sweet, sour, salty, bitter and umami), the texture, the aroma of the food, and the taster's internal psychological factors(1). Each food has the first three of them, as well as cues which trigger the fourth. 

I won't discuss the psychological factor here, as I don't have enough data on it, and also because it is not intrinsic to the food itself, but to the combination of food and taster. So let's look at the other three. 


Basic taste. This can be a hit and miss in related foods. 


There are practically no plants which are consistently salty. 
Umami is found in some (including the tomato you mentioned), but doesn't run in families. 
Fungi will generally have an umami taste, but don't forget that we are talking about a whole kingdom here, not just a few related plants. 
Sweet is also unlikely to depend on the plant family, it is more about the part of the plant. The most abundant source of sweetness in plants is fructose. From the point of view of the plant, it is a great way to store energy either for feeding a hungry seed or to seduce animals into eating its fruits(2) and spread the seeds. Besides, it is relatively easy to create if you are a plant. So plants from many families use it. But it tends to be produced in the fruits only, and only after they have received lots of sunlight. I suspect that there may be a chemical reason beside the evolutionary explanation (it is best for the plant when its seeds are only spread after they have matured). So, you can find sweetness in many plants with little relation. 
Sourness is due to the presence of acids, and also the absence of sugars (sugar masks our perception of acids as sour). The amount of acids is more plant-family-dependent than the amount of fructose. Some plants, for example the melons/cucumbers/pumpkins family, have very little acid in general, while others are very high in it, like citrus. Beside the amount, the type and distribution of acid is also different. LeBeau mentions rhubarb and sorrel: these are of the same family, and there are only a few edible plants which contain the same acid (oxalic acid). Citruses are high in citric acid, apples in malic acid, and grapes in tartaric acid. Also note that while most plants will concentrate the acid in the fruit, in other plants such as the rhubarb it will be everywhere. We humans can taste the difference between these acids when we are paying attention. So, while you are likely to find a strong relation between the plant part (fruit/not fruit) and sourness level, you will also find a variation of level within different fruits differing within the family. And across all plants, you will find differences in the taste profile of this sourness. 
Bitterness. This is the most family-dependent part of the five basic tastes. Alkaloids, a very common class of chemicals produced by plants, taste bitter. But each plant family tends to produce its own alkaloid (or other bitter substance), which have a slightly different type of bitterness. So, if one edible plant is bitter, then other plants of the same family have a high likelihood of being bitter too, and in a similar way (remember, this is different than the sweet situation - fructose equals fructose in all plants). 

Texture. This is not related to family very much. The texture varies tremendously within a plant, depending on which part you take from the plant. Cherry tree wood has a texture more similar to pear tree wood than to a cherry fruit or a cherry leaf. Texture is caused by the macro-mechanical properties of the most abundant stuff in plants, such as the starch in grains, the fructose-in-water sticky fruit juice, or the sturdy hemicellulose in stems and leaves. These are roughly similar between plants - two starches may be slightly different, but when packed in a kernel, they feel similar to the tooth. And frequently, the same family can produce different types of starches (you can have mealy or non-mealy potatoes, mealy or non-mealy rice, etc.). So, expect to find similar texture in plant foods not between related families, but within related parts of the plant. And besides, expect the texture to change drastically in response to cooking. 
Flavor. This is the area where relations are most apparent. Small differences in a molecule mean huge differences to the way it is perceived (I think that there were examples where it was not really the substance, but its racemic structure which mattered for how its flavor will be perceived). The aromatic substances in plants are family-specific and so flavor is highly related to the family tree of the plant. It is for example very obvious in taste that oregano and thyme are related more closely than, say, oregano and ginger. Similarly, the taste of pumpkins and melons can be surprisingly similar if you get a melon grown without sufficient sun (sun will produce lots of sweetness and aromatics in the melon, which will change its taste profile). Of course, there will be cases when just one plant from a given family evolved to contain a given chemical, which we consider signature for its flavor, and then people may start arguing that there is no relation. But if you take this one chemical from the mix, it will probably taste a lot like its cousins. There are also examples for plants without much relation containing the same substance and therefore exhibiting a similar flavor, but they are rarer. The chemical responsible for the flavor of anise is such an example, it is found in several plants without close relation. 


Note that your example is perfectly accounted for by this explanation. Tomatoes and potatoes are indeed part of the same family. But the potato is an underground tuber, while the tomato is a fruit, so totally different parts of the plant. None of them has a strong signature flavor - you can't smell a potato from far away. Tomato is better, but it still has other elements dominating its taste profile, including the interesting combination of sour and umami seldom found in other plants, and its juicy texture combining mealy-moist tissue with jellylike seed-studded substance which is also more acidic than the rest. We don't even eat the parts of the tomato which have most aroma (the stem and leaves). So, on the level where we'd expect most similarity - flavor - we have little contribution to the taste of either of them. On the other two levels, the fact that they are different plant parts dominates their level of difference. 



Footnotes

(1) these work in unexpected ways: for example, I once read a study where people had to guess the taste of gummy bears. The bears were rigged, so that the flavor did not match the color. People basically guessed based on color, flavor - they declared that the yellow ones were lemon, even though they had been flavored with cherry, etc. 

(2) In this post, I will be only speaking of botanical fruit and disregard the homonymous "fruit" as used in the kitchen. So, tomatoes are a fruit here.