A programmer can almost certainly be a leader, a mentor, and a coach for a team; a force multiplier for others’ work (through tooling, code review, etc); and many other things besides — all without being a “manager” in the project/product/people-management sense.
If you make your best programmers into PMs, though, you’re effectively asking them to do an entirely different job; one whose key competencies don’t have much to do with the key competencies of programming. A good programmer isn’t necessarily a good PM. A good lead programmer is more-often complemented by a good PM, with each playing to their strengths.
Also note, that this distinction has nothing to do with running the company as a whole — i.e. being an executive or officer. Some of the best CTOs I know aren’t PMs; they’re “just” programmers, but they happen to also be cofounders, and so they participate in all the executive meetings. (In a bigcorp you’re not going to see too many cofounder-programmers, but a “distinguished engineer” is close.)