Subject matter expertise and teaching experience up to six years make teachers better, as measured by students’ results. That’s better than nothing. There are lots of things we reward teachers for that have no discernible effects, like education degrees but if you go from a system where many of the Math teachers have humanities degrees to one where they all have Physics/Math/Statistics degrees results will improve. Ditto if you go from everyone having a Bachelor’s in Math to everyone having a Master’s. Teachers are far from completely useless, even if selection effects are far stronger than treatment effects.