> Yet somehow, the deficits keep increasing year by year.
The deficits follow a pretty steady trajectory regardless of which policies pass in any given year; a year in which UBI passed would be no exception.
> Even so, increased taxes on producers would result in increased prices for consumers. There's no free lunch.
Redistributive taxation is possible. The shape of the income tax curve doesn't affect production or prices (at least at first order): what changes is whose pockets the production goes into.
> Additionally B may be buying things like gasoline with this money whereas A would have just parked it on the stock market, which wouldn't have the same impact on consumer prices.
Parking it on the stock market has the same kind of impact, just on the cost of investment returns rather than on the cost of gasoline. (Hence why investment returns are so low). Buying future goods and services (by investing) isn't fundamentally different from buying other kinds of stuff.
Let's look at how consumption affects prices. There are two scenarios:
a) B wants gasoline to do something useful with. In which case, the value produced by using that gasoline is (generally) higher than the cost of the gasoline, gas prices go up because the economy as a whole goes up, more gas is produced because the higher prices justify more difficult kinds of oil drilling and so on. This is a positive case for everyone, even if higher gas prices might sound bad in isolation.
b) B wants gasoline to play around with; prices go up but the rest of the economy doesn't. This is the negative case.
Basic necessities like food and housing are, almost by definition, things that people buy for productive purposes rather than for unproductive consumption. Food prices don't go up if we redistribute food consumption; food prices only go up if overall food consumption increases. But food consumption is only going to increase if there are people who want more food but are holding back because they can't afford it - and in that case we should definitely want those people to be able to buy more food, even if that means increased food prices (and food prices should go up, to stimulate more food production, because clearly we weren't producing enough food to start with).
We can imagine a shift between different kinds of productive use. For example, maybe in a UBI world there is less demand for luxury cars and more demand for basic cars. But in that case prices should only shift a little: the car market is efficient and competitive (i.e. cars are a commodity), luxury carmakers can retool towards producing more basic cars.
Equally, we can imagine a shift between different kinds of unproductive consumption. Maybe fewer people want to watch opera and more people want to watch pop concerts. But again those are more or less commodity industries; as long as the cost is stable-ish, changing demand is going to mean slightly higher/lower prices and production will change to match, but the nature of a commodity business is that every company in every one is making more or less the same (low) level of profit.
What really matters is when and how the use of real value shifts between productive use and unproductive consumption. I'd expect that the rich use a much greater proportion of their income unproductively (looking at the big picture: e.g. maybe they put it in an investment that becomes their child's trust fund, but is ultimately spent on partying) than the poor. Certainly it's hard to imagine that rich people are often being held back from doing things that would be more productive for the overall economy because they can't afford to, whereas it's easy to think of cases where that happens for poor people: can't afford to take a better job because they can't afford to move, losing their job because they can't afford gas, performing poorly at work because they couldn't afford to eat enough, etc. Investment is currently a pretty unproductive use of value (as seen by how low investment returns are), because the economy already has more than enough investment in to pursue all the actually productive projects it can think of. And surely rich people spend more on consumption in the most direct common-sense form - decorations, entertainment and the like - but hit diminishing returns; wouldn't poor people get much more (aggregate) joy out of the same (overall) expenditure?
I guess if you think rich people are living frugally and putting all of their money into productive investments, then you could think that poor people spend a greater proportion of their income on wasteful consumption. But I find it very hard to imagine that that would be true in terms of the overall averages.