You evaluate a programmer on the coding problems they solve that contribute to the business.
There is nothing so clear for teachers other than their class performance on standardized tests, but standardized tests measure only a very limited part of what a good teacher should be able to offer.
This is how you get lots of low-hanging fruit pickers, rather than programmers who would rather solve hard problems for more significant, but less visible, business needs.
Examples: Refactoring is effective in the long-term but doesn't look as good in the short term. Exploratory work often takes time but doesn't show any specific productivity. Teaching and helping others is incredibly value, but increases their productivity rather than your own.
Evaluating programmers by their business output leads to low-quality code run by a team that doesn't talk to each other and loves self-aggrandizing. Also when something big finally does slip through the cracks, everything will fall apart.
And if you want to find outliers with it, good luck - they'll make mountains out of their molehill of work.
Honestly, it's not very easy to get good metrics for programmers - for the same reason it's not very easy to increase programmer productivity on a project. It's not easily divisible work and involves a lot of teamwork.
Two reasons:
1. Evaluating people by "solved problems" encourages them to solve problems rather than do other kinds of work - which is often more important.
2. You can't evaluate people by their real performance - only their perceived performance. You're splitting them up individually to do so as well. As you are a human being, your perception is biased and your information is incomplete - there are many, many people who would take advantage of that to make their work seem more important/better. Hence, self-aggrandizing.
If you want people to do their best, give them the power to do self-evaluation and ask them to find ways to improve their work/their team's work.
If you want to fire people, your absolute worst employees - the bad ones who somehow survive layoffs, are the ones who are going to abuse your perceptions and metrics the most. The only way to get around this is to gather metrics in ways that can't be self-reported or influenced by the individual being evaluated, even indirectly, except by being competent at their job.
There is nothing so clear for teachers other than their class performance on standardized tests, but standardized tests measure only a very limited part of what a good teacher should be able to offer.