a post-Scarcity economic environment in the universe of Star Trek is impossible -- especially when you consider TNG and Cmdr Data.
All wealth is the application of human ingenuity to natural resources.
Resources in the universe are already consumed faster than they are produced. The uranium we have now is billions of years old. We have only been using the uranium deposits on Terra for about 70 years.
The hydrocarbon fuels on earth took somewhere between 10e4 and 10e7 years to form. We've depleted a massive amount of this resource in the last 150 years.
The main resource that limits the speed at which we can extract and consume resources to create new wealth is the amount of human labor required to create the wealth.
In other words, if we wanted to, we could mine all of the remaining coal in the world in a short amount of time; limited primarily to how much human labor we could allocate to this task.
Humans continue to improve the speed that some resource can be consumed by building tools, machines, etc, that increase their productivity.
Cmdr Data is, in a sense, the culmination of this effort. He is a synthetic human; more capable than other humans, and with (presumably) the ability to replace himself.
He is the singularity. Once he exists, there is no fundamental limit governing the rate at which the remainder of the universe's resources can be extracted and utilized.
All higher-order matter in the universe, whether it is uranium or hydrocarbons or anything else, represents a chemical battery of the only fundamental energy source -- star radiation.
Post singularity -- when machines can replicate themselves by consuming resources, to build more machines to consume more resources -- it is theoretically possible that all of the star-energy "batteries" (all higher-order matter) will have been consumed. At that point, the agents within the universe will be limited to consuming energy at the rate it is globally emitted by the stars they have access to, less capture efficiency losses.
Human conflict still exists in TNG, and cross-species conflict also exists.
Humans consume resources more quickly than humans or societies that they are in conflict with, to give them an advantage.
The fact that human ships with life support systems exist in the same universe with a super-human artificial intelligence suggest that resource consumption and production are not unlimited. There is still a limiting function.
Thus, resource scarcity still exists. The resource extraction singularity has not come to pass in TNG, despite the many advantages it would bring to those entities that were in conflict with other entities.