In real estate you use a lot of leverage, for a residential home it's typically 5:1.
You put down 20% on a $1,000,000 home, the initial investment costs you $200,000 cash. Home price appreciation is over the long run approximately 3%, which is 2% the long-run yearly inflation expectation + the 1% yearly population growth expectation.
If your house appreciates 3%, it goes from $1,000,000 to $1,030,000. That's a 3% return on the total value, but because you only invested $200,000 cash, it's a 15% return on investment. To get a similar return on stock indexes you need to use 2:1 or 3:1 leverage or invest in individual stocks which is far riskier. You can also get higher returns by directly operating a business but it requires a lot more effort.
So buying a home is seen as the lowest risk way to get high compounding investment returns. Obviously it's not that simple as you can have recessions and lose your job or the neighborhood becomes run down and the house doesn't appreciate as much, you need to cover the cost of interest and maintenance, etc.
Most people don't conceive of it like this but that's the fundamental reason why it's popular is because of the leveraged returns.