Why have the control go through a sophisticated programmable chip and not just use a simple transistor/relay directly connected to the sensor?
This is just the way people design circuits these days, because it’s easier and cheaper. A single µC with a few GPIOs, rather than a bunch of logic chips scattered around the board.
The goal is to make this so it cannot be overridden in software. By designing hard-coded logic in a chip that already exists, you can get the same level of security for essentially zero cost.
And if an attacker is able to connect a chip programmer on your motherboard, you have a totally different threat model and bigger problems to worry about.
Have you ever seen a MacBook from the last 10 years? There are no physical switches, it's an hall sensor that works with the magnets that keep the thing closed.