In their world, being unmarried and expecting a baby is a very big deal. By getting married before the baby is born, they are preventing the child from being born a bastard.
And her mother is probably crying and complaining all the time about them not being married. So doing so and as soon as possible will make everyone's life a lot more peaceful and will probably make Grandma more accepting of the baby and make better her relationship with her daughter.
I've seen grandparents and great-grandparents refuse to visit a baby because the parents are unmarried. If this is the case here, it's better for the grandmother, parents and the baby that they get married.
Family members reject a child because its parents are not married?
I can't think of many worse reasons to marry.