How do you prevent the pilot from crashing it like that GermanWings flight?
Empirically speaking, this is the case. Many crashes would have been avoided had autopilot flown. This is as true in air transport as general aviation.
In other-than-normal conditions the computer is almost always wrong.
These protections are increasingly lost as you move into alternate laws 1 and 2. And no protections whatsoever in direct law.
In most emergencies issues pile up so quickly that these modes tend to activate more often than not (and confusion about which mode is active has led to several fatal crashes)