If the cost of that automation (programmers, testing, etc) is greater than the cost of training pilots, then pilots are going to remain.
Usually, there ends up being a middle ground - you automate the low-hanging fruit, and leave the last percentage points to the humans.
EDIT: I understand that there is research going into making computers recognize "novel" situations. My comment only applies to algorithms that contain "checklists".
Sure, it can be tough to tease out the algorithm from the minds of current pilots. Luckily in aviation we already have training manuals. In other domains it'd be tougher to know when we're done extracting knowledge from humans.
b) Said human pilot was aided considerably by the airplane's autopilot system
c) I'm not sure why you think software would find this particularly challenging?
Some on-ground duty pilot sitting in a simulator who's suddenly placed in control of an aircraft that's notified an anomaly seconds before landing has absolutely zero chance of being able to make the same judgement call as a human (co)pilot who's been sitting at the controls for the last few hours. And the likelihood of human input being required is highly correlated with the possibility the aircraft has lost connectivity and/or some of the equipment that's supposed to be sending back data is malfunctioning (and yeah, you could build in more redundancy, but that still doesn't eliminate the problem and probably costs more than the pilot)