Yeah, trees are custom designed biorobots that make apples, cherries, etc that are way bigger than their wild counterparts. Yes, there is a
lot of human work involved in nourishing the trees, keeping pests at bay, harvesting, distribution, etc. But in the past 200 years, the farming industry has seen one of the biggest transformations in how many workers are required, as in 200 years ago high percentages of the working population were employed in the farming sector and now only very small percentages are.
The remaining farmers still need things like fertilizer, people who service machines, etc, and they still have to put in work themselves. In fact farmers are some of the hardest working people I know. But the trend is still true, there are less and less farmers who generate more and more output.
You definitely need some way to distribute those resources to farmers (and other industries) in a good fashion, and in history the market economy approach with pricing autonomy has proven to be the best way. So money will likely not go away in itself, but economy will be more about resources in the future than about work.
That being said, the economies of even the rich nations are still highly dependent on human output so it's still way too early to discuss about UBI, but if we should find ourselves in a situation where we have literally no use for the work output of large percentages of populations, then we really need to think about some way to distribute resources to them so that they don't starve/riot.
If you say that only millionaires should be able to live without working, then you should look at what makes that millionaire a millionaire: their 20 rental properties? worthless if nobody can afford them. Their 5 square kilometer fully automated farm? worthless if nobody can afford the food. Their 100 million investment into a big company? likely that company is also out of business if nobody buys from that company. Sure maybe yacht builders will continue to have a great time, but that's a fraction of the economy. A lot of current millionaires would be rendered quite poor in a non-UBI future, as a lot of wealth is generated from serving existing customers.