They're actually not great from that perspective: when you count the portion of tuition that professors are expected to pay (at least at U.S. institutions), PhD students aren't any cheaper than postdocs, and typically less productive / require more hand-holding.
Now postdocs, there's a deal: accomplished researcher who already has several degrees in the field and knows how to write papers and conduct experiments, available for ~$45-50k.
For "normal" faculty members (i.e. those not waving around Turing awards, Fields medals, and Nobels), the number and quality of Ph.D. students (where I'm from, Masters didn't count) the professor has advised is one of the most, if not the most, important prestige factors.
Getting grants and writing papers will get you tenure, but are significantly less important after you have it.
I agree that's generally true, though my sense is that in CS it might be shifting somewhat: an alternate route to level-up once you get tenure is to go all-in on the big-money grants and hiring personnel. Start pulling in some multi-million-dollar DARPA projects and hire not only post-docs but more senior staff researchers, and an army of programmers, and become a manager of a bustling research enterprise. Then you can start working media appearances (maybe through the help of PR staff you've hired, even), that kind of thing. Those kinds of profs often don't bother with supervising grad students anymore, or pawn off the job on someone else in their empire. It's sort of like running a little consulting firm within academia.
In areas with fewer DARPA-sized projects, students are definitely the best way to get major influence, though, since producing research progeny is a good way to spread ideas, general approaches to research, etc. It seems to be particularly the case in mathematics that certain mathematicians are influential in part because they mentored a substantial portion of a generation of researchers.