I know of two classic beers that should be consumed young and taste awful when aged - Belgian Wit and German Hefeweizen. What they obviously have in common is that both are wheat beers. Does that mean that wheat decreases shelf life and tastes better on young beers?
'Does that mean that wheat decreases shelf life[?]'
In certain instances, yes. Higher-protein wheat can lead to haze instability (you probably don't care in a wheat beer but you might in other styles). The proteins may also lead to flavor instability, for instance in the presence of dying yeast cells (the yeast excrete an enzyme [protease] into the beer upon death, which breaks down proteins, affecting the beer's flavor).
'[...]and tastes better on young beers?'
Possibly, since wheat has a pretty mellow flavor to begin with. But that's largely subjective.
However there are too many other things that make these beers better fresh as opposed to aged to single wheat out as the culprit:
Both are relatively low in alcohol, which is famously preservative in aged beers. Low alcohol beers also require less conditioning before they are fully developed in flavor (fast-maturing, as the BJCP link says). Both good reasons to drink something sooner rather than later, and one reason you typically see aged beers being ~8+% ABV.
Both are low-hop beers, presumably to keep from muddling the complex ester/phenol highlights these styles are famous for. Hop bitterness can inhibit growth of certain beer-spoiling microbes if sufficiently present. Below 15 or so IBUs, there's no significant protection. So smaller-than-usual levels of contamination could potentially affect the flavor stability while aging.
Both feature distinct yeast characters, notably phenolics and esters (cloves and bananas, respectively), which tend to fade over time as their chemical constituents oxidize or otherwise react to form less flavor-active (or less pleasant) compounds.
So it's not so much that wheat can't contribute in its own way to instability, rather that if it does it's just one among a number of reasons, for these two specific styles.