The common explanation is that Amy comes across as an overeager admirer who constantly chases after Sonic, and that attention tends to get on his nerves.
On top of that, Sonic's affections are often said to lie elsewhere in the series. So it's less that he dislikes Amy outright and more that her relentless pursuit doesn't match what he's looking for.