In my university a professor isn't usually newly hired for undergraduate level CS course teaching- but the university doesn't want to hire a non-phd to be teaching undergrads. It's not a good look for a university to be hiring non-phd bearers for its teaching positions. However, CS PhDs can (relatively) easily go into industry or tenure-track dependent on what their research was about, so there's not many PhD people who are willing to take a teaching position.