Both spending and investing help grow the economy, but investing helps more.
How do you figure that investing helps the economy more than spending? I agree that investment money is very important, but you only need so much of it, which is dependent on how much demand there is for it. Let's say you have to figure out where to get $100B in extra tax money. If you take it from the rich, then the poor and middle class get to keep $100B, most of which will be spent soon thereafter, which drives the economy. If you take it from the poor and middle class, then the rich get to keep that $100B. They already have plenty of money, so most of that goes into the stock market and real estate. That increases stock prices, which mostly helps the rich get richer, and it increases real estate prices, which makes it even harder for the poor and middle class to afford it (e.g., houses).
Your examples of spending money on stocks or on real estate are not great because they are really no different from spending money on cars or on groceries. Besides, giving out money to spend on cars and groceries drives up those prices just as much as stocks and real estate.
Having more money to spend on cars and groceries doesn't necessarily mean prices will go up over the longer term (although they may in the short term). Yes, one way for a market to balance when demand increases is for prices to increase (short-term effect). But the other way for it to balance is to increase supply (long-term effect). If demand steadily increases, that drives industry expansion and increased production, which creates more jobs and economic growth.
So you're right that real estate may not be the best example because supply will eventually respond to demand. However, such rebalancing happens much slower in real estate that most other industries.
So, let's talk about core investing, giving money to people to build or create things. You know, companies, infrastructure, houses, farms, etc. -- the stuff that creates jobs and increases everyone's standard of living. The economy grows through production, not consumption. Investment increases production.
I agree that investment increases production, but over the long term, increased production means nothing without increased consumption.
I think we're basically getting into the classical debate here between supply-side and demand-side economics. First, let me say that I think the ideal situation is when the two are balanced. If demand greatly outweighs supply or vice-versa, you have all kinds of problems. I think it's best if production proactively keeps up with anticipated future demand so that you get efficient markets with few price fluctuations.
That said, I prefer demand-side to supply-side because, IMO, focusing on increasing demand before supply leads to a more guaranteed and predictable rate of growth. The drawback is that it can lead to higher prices.
My basic argument here is that you can increase production all you want, but if typical consumers don't have money to buy your products because it was taken away by taxes, then it makes no difference. I understand that the idea behind what you're saying is that investing money in, say, factories will create more jobs, thus putting more money in the hands of consumers, which will drive demand. In theory, that sounds good. But who, other than venture capitalists, invests in more factories when the demand doesn't exist yet, and they're unsure if or when it will? Now, if the economy is chugging along and there are clear indications of increasing demand, then sure--that would help to achieve the ideal balance I was talking about before. But if it's not, why would you increase supply?
Reading through what I've written, I realized that my take on things is probably very colored by the 2008-09 financial crisis. Most of what I said is based on unhealthy, uncertain economic times when you don't know when demand is going to increase again.