The main issue with threads like these...."I could pay cash, but I'd rather invest it" is.....
I don't believe the regular guy making monthly payments on anything, is putting the exact X amount of dollars into stocks or ETF's on the 15th of every month instead.
Now, if you have a mortgage balance of $200K, and you also have $200K+ in your taxable brokerage account that is liquid, then OK, you can pat yourself on the back....I guess. But the reality is, you are in the top 2% of people in the United States, and are really just humble bragging. Most guys anywhere, therefore here, are not in that situation, so this conversation is nothing more than a circle jerk for a few, and for the rest who don't have what you do....a theoretical rationalization to affirm having debt, which anyone who has been on the other side of it knows is not preferrable to being debt free.