In the U.S. at least, you don't usually have a choice to opt-out of chasing tenure if you want to continue teaching. Barring some unusual situations, there are either non-tenure-track fixed-length jobs, like a two-year visiting professorship; or tenure-track jobs where you have six to seven years to get tenure in order to stay. Non-tenure-track but permanent positions are quite rare, and in a tenure-track position you can't choose to simply remain at the untenured Assistant level indefinitely—you'll be fired after six or seven years if you don't successfully go up for tenure. It's a classic "up or out" style job in that sense.
Once you get tenure, then the advancement ladder does become somewhat optional; an Associate Professor can stay at that level for the rest of their career, with no requirement that they ever seek promotion to full Professor. Some universities are starting to put pressure in various ways on insufficiently productive tenured faculty, but there is at least more insulation from the advancement ladder at that point. But before then it's non-optional if you want to stay.
Is getting rid of people with over a decade of academic experience because try didn't achieve enough research results or even just didn't impress those recommending them enough really optimal?
Needs to be something like a teaching track, where teaching then becomes the main focus. Maybe still participate in the research going on but not drive it.
CMU is unusual in being a top-tier school with that arrangement. They actually have three tracks of professors. There's still a "regular" professor with the usual research/teaching mix. Then there is a "teaching" professor, which is also a tenure-track/tenured position, but judged mainly on teaching with research secondary; they are not expected to bring in as many grants or publish as many papers, but teach more courses per semester and are judged more strongly on their teaching quality. And finally there's a "research" professor, which deviates from regular professor in the other direction: they're judged mainly on research, with a lower teaching load, but a higher expectation for grants and publication output.