tax bracket only factors in if you otherwise are able to itemize.
as to market rates being better than mortgage rates historically, that may be true over a long period of time. However, there are many 7 - 10 year segments that it is not true. The other reality is that most people's investments under perform the market average. So if the DOW averages 10% over x period of years. Most people's ROR will be less than the average due to transaction costs, advisory fees, money manager fees, etc. etc. There is also the cost of panic buy/sells where people choose to get out or in at the wrong time, as well as the potential additional tax costs with mutual funds (funds buys IBM at 2, IBM is at 8 when they buy, IBM drops to 5 and is sold by the fund -- you get hit with a 1099 for the rise from 2 - 5 while you suffer a loss from 8 -5).