Didn't Gandalf eventually decide that it was a higher power, and not just his liking for them, that brought him to associate with the Hobbits, because their simplicity and lack of ambition made them the only possibility on Middle Earth to dispose of the Ring. We know what would have happened if a man, elf, or Wizard had gotten their hands on it, and the dwarves would have used it to get all of the precious metals and jewels on earth into their possession.
One of the reasons to force yourself to read the Silmarillion (it took me two or three tries myself) is to understand that even though LOTR does not mention God directly, the WOTR is just one more refrain in the Great Music of Illuvatar (God.) So, we can reasonably assume that Gandalf's association with Hobbits is not an accident. It is part of a greater plan, as Gandalf himself intimates about many things which happen in both "The Hobbit" and LOTR.