Well, I think it's the way society society is built. For boys, their mothers are their first point of call, especially when it comes to emotional attachments. They feel closer to their mother because they are the symbol of love. The father most times would want to mould the boy sons into replica of themselves. They are told how to behave, how that men don't cry, men should be hard and so on. Many a guy can't relate with this. So, they resort to their mothers who aren't ashamed to cry or be emotional. They find solace in the fact that they can be real to their mothers and not judged about it.
Then for the female child, it's that connection together someone other than her mother. The father figure may represent someone like a hero, someone she looks up to for protection.
Also, the father figure may not be quite as hard to the male child as to the female, so this makes the girl child more close to the father than the mother.
However, most of these things would iron out later in life. The boy would later find out that his dad is just trying to do what's best for him and so being harsh doesn't translate to being wicked. They go out for camping trips, etc.
The girl gets closer to her mother when she's grown up and probably married. She learns to take care of the home and be a better wife.
According to Sigmund Freud, this phenomenon stems from the boys developing Oepidus Complex and Electra Complex for the girls.
The trend begins from when the boy or girl starts noticing they have something in common with their father or mother respectively. And also some things their father or mother has that they don't.
In the case of the boy, as soon as he is conscious enough to know he has the same attributes like penis (especially penis) with his father that are different from those of his mother. He starts to unconciously 'feel' a competition with his father for his mother's attention and time.
According to Freud, he is likely to develop Oepidus Complex, which results in the fear or suspicion of his father taking away that thing they have in common. All these plus the motherly care make him to start bonding with his mother more.
It is more of the same for the girls, once a girl starts noticing unique attributes in his father that are different from those she possesses with her mother. She become envious of those attributes. She starts seeing her mother as a competition for her father's attention and time (which is the goal).
A girl deprived of that fatherly attention and time may likely develop affections and desire for men that has the same behaviours like her father regardless of whether they are good or bad.
Also at puberty, when both genders start desiring members of the opposite sex who are mostly unavailable all the time (or at all). The girls find solace in their fathers and the boys in their mothers. Which is why In a normal home, a girl 'earliest' boyfriend is her father. And the boy earliest girlfriend is the mother.
This theory is from Sigmund Freud and my reference is a post I made on "Daddy Issues" about 6 months ago. Here is the post
I would say it's dependant on culture and the environment they're raised in. I agree with Penauthor in most respects, but it can also depend on the availability of the parent in question. My daughters, for example, are closer to me, because their father isn't always available or interested in their interests. They want him to be and he does try, but emotionally they can't rely on him. It could well be that this would be different if we had any boys.