At this point it's just antiquated advice, but it's an easy and well-described thing to put forward as a general trading theory. Buy an index fund and just wait for decades.
To put it another way - it rolls off the tongue better than "buy a weighted amount of a CSRP (or comparable) US Total Market Index and FTSE (or comparable) Global All Cap ex US Index, where your weighting is probably slightly overweighted to domestic".
Often (usually?) when people say it, they aren't literally advocating to only buy S&P 500. Some people still do recommend this, but I'd wager they're closer to a minority now. Famously I'm pretty sure Warren Buffett is still advocating S&P 500 only, and it takes a long time for voices like Michael Burry to outweigh. Vanguard pushed out a whitepaper years back, and made a very public change in their own corporate 401k to get rid of the s&p500 fund choice.