If you think about it, even a fully autonomous aircraft still relies on a control system that functions based on a set of instructions created by a group of humans that designed the controls using their own best judgement on how to deal with any particular situation they thought the aircraft might encounter.
This approach works very well in most cases, but there are the rare situations where a skilled pilot with the ability to make split-second decisions can do a better job. When it comes to ensuring the safety of commercial airline passengers, the added cost of having two qualified pilots in the cockpit is money well spent.