It comes from an episode of "The Big Bang Theory." Here's a transcript found on the Internet:Big Bang 15.
I was befuddled by "with a thing for"; it looks like "have something" to me.
Thing is used synonymously with affinity. It only really is heard in the context have a thing for:
All of these are meant to convey a seemingly inexplicable interest.