Other factors that could cause this correlation are wealth, paternal stability, and a caring family nucleus. Families with these factors usually have secure attachments because the children feel accepted, have few worries, are cared for, and are trusting in their relationships. Supporting the correlation from the other side, families that are poor can lead to fostering insecure and distant relationships because of harsh living conditions, abuse, drug use, and neglectful parents. However, there can be poor parents who are very nurturing and helpful and rich parents that are abusive and distant. These are just a few variables that could explain this correlation.
I agree that having a caring family nucleus leads to secure attachment but I don't think that wealth or paternal stability do. If a family is wealthy, the child may have all his or her basic needs satisfied but a parent can still neglect spending time with the child and have a nanny or babysitter care for the child instead. Also, parents can be stable together but if they are both working long hours then they cannot spend time with the child and the child will feel anxious/avoidant. They will not be use to the parent's presence of being there and thus ignore them.
Although nljuboja has a good point, generally these cases hold true. People who don't need to worry about paying the bills, can instead invest their time in raising the smartest kids on earth. Oppositely, people who do need money, can inspire their kids to work hard so they do not need to experience debt. However, the first case is probably more prevalent in our society, but I do not deny that the second case cannot occur. It is just, psychological research is made up of generalizations and not specific cases. So, the wealth, paternal stability, and caring family nucleus is definitely a factor in secure attachments.