He's been immersed in Chicago's black community for most of his adult life. I know in my personal life, I deal with people from all over, and I adapt to the conversation -- I don't consider it pandering, and at times it's not even conscious.
The issue with Hillary isn't that she used the words -- she was quoting after all -- but that she adopted an accent that sounded forced. When I talk to Georgians, or New Yorkers, or Texans, or Californians, I don't try to sound like the person I'm talking to -- it's a more subtle matter of pacing and rhythm and word choice. Sounding like someone you're not is something that even good actors with a good dialect coach often can't achieve.
The most extreme example was when I went to Thailand. With few exceptions, the people I met who knew English didn't know it very well. So within a day or two, I fell into a sort of pidgin. It wasn't a conscious choice; it was just the best way to get the message across.
We can grant that he picked “y’all” up in Chicago, but that raises the good question as to how credibly the message of scholastic achievement can be delivered in “street” English.
“Do good in school, y’all,” is a self-negating message, at least where standard usage is concerned.