I think that Connor has a deep desire for family, normalcy and stability, things which he's missed his whole life. Connor was raised in a hell dimension and while Holtz showed him love, he also trained him as a soldier from a very young age, which included traumatic events such as tying him to a tree and leaving him there to fend off demons and fight his way back home. Holtz also told Connor of his true parentage, the nature of vampires and his own deep hatred for such creatures, which would have instilled a sense of self-loathing in Connor, making him reject that side of him. Add all these factors together, and you have one very messed up and confused kid, who probably longed for a normal family and a sense of stability.
As far as we can see, he receives this from Fred and Gunn. We see that they build up a level of trust, care and affection with Connor, taking him patrolling, fixing him meals and essentially acting as surrogate parents to him. I think that Connor probably initially hung around to ensure that Angel didn't resurface (hehe, pun intended) but then he became attached to the love and comfort which Fred and Gunn provided him and actually became somewhat happy and secure in the home environment they created for him. For the first time ever he was allowed to feel normal, to live in a (relatively) safe environment and to be cared for by people who had no hidden agenda and who treated him well.
When you think about it, it's really sad that this dynamic was dropped so abruptly after the season opener. Gunn and particularly Fred obviously formed affection for Connor during this period and even though they felt betrayed by his actions, in retrospect it's odd that they turned on him so easily after Angel returned. This is a kid whom they spent three months taking care of and formed affection for, yet they up and abandon him and treat him with hostility and suspicion for the rest of the season. Yet another example of Season 4's clumsy writing.