In your post, you are clearly trying to show that long term stock returns are much higher than real estate. So if you want to make the comparison fair, you have to include rental income.
As you said, you can either pay cash or borrow with mortgage. If you pay cash, I don't have data in front of me, I got to believe the long term rental yield is higher than 5%. So you have to include it in your total return. Today, you can easily get 6%-7% in some areas, much higher than treasuries. If you borrow, then your real estate return has to include leverage effect. Assuming your mortgage and tax costs offset your rental income if you borrow 80%, then your return on the property should be 5 times the price return because you only put down 20%. You can't only include costs but not adjust for your investment principle.
I am not saying real estate is the best investment. I am simply trying to make the comparison fair so that people won't be mislead.