A lot of this is because the hiring pipeline has dried up. I went to a top hs here in the Bay Area and had teachers who were very knowledgeable and invested in STEM education.
Because of extremely low salaries when factoring in CoL, a replacement pipeline hasn't formed. I had 4-5 of my classmates in HS end up majoring in STEM and minoring in Education at the big 3 UCs, but all of them decided to become Data Analysts or SWEs instead because they would be provided a living wage without having to go get a masters for an additional $30-40k and/or a formal teaching credential for an additonal $12-15k. They were looking at a $150k bill just to earn $70-80k starting AT BEST in Silicon Valley.