Do pilots still need licenses in the age of autopilot? Well yes because machines aren't infallible.
Not quite. It's "yes" because most people would be unable to get over their fear of flying in an entirely autonomous plane, not because we need heroic pilots to override the computer when things go wrong.
Consider that about half of all aviation accidents are traced to pilot error. The percentage of crashes caused by autopilot error is zero.