Almost everyone has their favourites. Some teachers are a lot more subtle about it and make a conscious effort to be fair, but I sincerely doubt there's a single teacher at Hogwarts except for maybe Professor Binns who hasn't had some students that they liked better than others.