Bed-sharing between parents and children has been going on from time immemorial. Its decline in official statistics only came about 150 years ago and is down to several reasons.
Until the 19th century, children shared their parents' bed, or in any case they didn't sleep alone. Because of heat, safety, space, convenience and breastfeeding, the family slept together.
During the course of the 19th century, new and powerful norms emerged as a result of religion, medicine, psychoanalysis and economic change. Sexuality entered the debate: it was thought it had to be 'controlled'. With the conjugal bed becoming a privileged place, it was time for children to be kept at a distance.
Along with these new ideas, medical advances and discoveries about germs and hygiene contributed to the decline in bed-sharing. Psychoanalysis was also a factor in changing the conception of parent-child relationships: parental sexuality became taboo and children were no longer meant to be present at "primitive scenes" between their parents.
So to conform, babies had to learn to sleep on their own. But there's no scientific justification for it, and to date there's no proof that parent-child closeness at night causes any psychological damage.