There is no real reason given I am aware of, but "Sentient" Piloting in Sci-fi is usually done just because we want it to be that way. Similar to why there are manned missions in space. It's not because it's better or we're getting some benefit from doing it in terms of the goals that we're trying to achieve, but because we connect more easily with the ideas of space travel by making things manned. This is why a manned missions to the moon were done and manned missions to mars are being planned, to raise awareness and excitement for space travel. In short... Marketing. Imagine if Star Wars didn't have sentient creature piloting starships. It'd be wholely different movie that we'd probably like less.
That being said, there is a real reason to have sentience behind the wheel as it were in Sci-fi generally and which is decision making, culpability, and as a security measure against various things that could happen. It's not that Non-sentient AIs wouldn't pilot too, but rather the piloting would be done more symbiotically in most circumstances, and which ever is better in times that it is needed.
As why it happen in Star Wars. The simple answer I'd assume was the right one is the Force. Droids don't feel it nor can they interact with it. Sentient's can and do on various levels. The more in touch with the Force a pilot is the better they are. This has to do with spatial awareness, being able to predict and detect things before sensors can, and manipulate things that otherwise couldn't be done. The best pilots are Jedi and Sith, the second best are untrained Force users. Surely the Jedi and Sith have not collect all Force users, or even a great number of them, especially not before their cut off date for starting to train them, and as a result you have a ton of people who are Force Sensitive that would find that like, Anakin and Luke, are incredibly good at piloting and likewise military would find that a good number of Sentient Pilots were out performing Droids and as a result would stick with Sentient Pilots rather or in combination with Droids.