I don't think he just wished it away. The end of money as the motivating factor was, as Picard delivered in his soliloquy, due to replicators and obtaining anything material of your desire. Pursuits moved away from material things and toward self-improvement, learning music, painting, achievement. This might sound like an impossibility, but, keep in mind something similar has already happened in our civilization with another resource that once was scarce: the calorie.
The scarcity of calories made us "greedy" toward sugars and fats. You can imagine a "wealthy" caveman from 30,000 years ago as being one who would kill his neighbor and steal their food. Food was everything, something you would toil for hours every day to get, go to war over neighboring tribes to secure your hunting areas. Today, food is a joke, we laugh at fat bastards who stuff their face and can't control their urges and desires for food. While Gordon Gecko famously said "greed is good" in the context of making millions on Wall St., when in the context of layering on the fat, no one thinks that's good. We admire people who don't overeat. We don't consider thin people as "poor". We don't consider fat people as "rich".
It's already started to happen with material goods. In the 1st world, many of us are moving to a post-scarcity world. I've already felt disgusted going to the apartments of girls I date and seeing multiple closets full of shoes, floor to ceiling. They brag about how they have 200 pairs of shoes. I just feel sorry for them. It's like seeing a fat person brag about how many tires they have on their stomach. Imagine a world of replicators. Imagine certain people hoarding thousands of shoes. Hoarding floor to ceiling of junk. Sure, they might be emeralds, rubies, diamonds, gold, but in a world where that stuff is abundant, it's junk. You just feel sorry for them. Then you see someone else who lives in a clean and barren apartment, doesn't fill it with jewels or other junk. They practice music, they sing in such a lovely voice, they have a friendly personality, always make you feel like a good friend, go into riveting conversations about multi-layered abstract ideas that have you pondering about our place and existence in the cosmos that even years later in the shower you drift back to and ruminate over once again.
You might say, well, money isn't just used to buy material goods, it's also used to gain influence, pressure and bribe other people. But, you see, that influence comes because at the bottom of the food chain are the poor who desperately would do anything for material goods. Why do people do the jobs they dislike? Ask any garbage man why he does what he does. Ask him if he would still do his job if he a had a replicator. People will do the jobs they enjoy. I don't think Star Trek advocates Marxism, but Marx definitely advocates replicators. In Marxism, he said communism would fail in any poor country. He never envisioned it for Russia, and he thought the rich countries were the closest to being able to implement it. It requires a post-scarcity society as a prerequisite. Just as we are presently at a level of civilization where we say "dying on the streets due to starvation is anathema and we are too rich collectively for that!", we are slowly but surely getting to the point where someone decades or centuries from now may say "living as a poor and destitute person without a replicator and solar energy is anathema and we are too rich collectively for that!"
I know you must be thinking, "whoa, hold on, won't that cause rampant inflation?!". Yes. On the path to money having no value will inevitably be a transition state where money has very little value. The reducing value of money is what inflation is a measure of, after all. When garbage men stop doing their jobs, you have to pay them more. As long as money has some small value, paying enough of it will still ensure people do things they don't like. But, eventually, money will have so little value, next to zero, that it will become uneconomical to use it to motivate anyone. If you and your roommate are both millionaires, you can't just waive a $20 at your roommate for them to do all the dishes and clean the place. Technology, replicators, and artificial intelligence will fill the void of what was once the underclass. Anything that a machine cannot do, you will need to persuade people through charisma, leadership, and vision. People won't follow the rich. People will follow leaders. This is how Gandhi led a nation to independence despite lacking immense wealth. He had no SuperPACs, billion-dollar trust funds, and couldn't pay a legion of staff to serve him. But people served him. This is why people can volunteer and serve in a hierarchy inside a non-profit. If their job sucks, they stop doing it. A successful non-profit motivates people by having everyone feel a sense of pride in improving the world.
You might scoff that volunteers are rare and there's no way everyone will volunteer to do work. While I agree it will be a long and painful process as we adapt, I believe we will get there. Just as morbid obesity is rampant as we adjust to becoming a civilization of abundant food where we need to have self-control over our literal appetite and change our unwillingness to exercise, we will need to decrease our metaphorical appetite for gems, jewels, shiny things, and change our unwillingness to volunteer labor. Those who don't, those who never volunteer, hoard rubbish floor to ceiling, will be seen as tomorrow's obese. It will become an epidemic. It will also be considered disgusting. We are social creatures, and we will conform the standards of tomorrow's society. Not overnight. Our urges are deep-rooted and come from hundreds of thousands of years. But we will change.