Having a child outside of marriage is not a sin. Repent of the sin of sex outside of marriage, yes. Reap praise upon the head of any unmarried woman who carries her child to term instead of aborting the child and offer them assistance to support that decision. Others may want to repent of the sin of judging the intent of others’ hearts or the state of their souls.
Of course the Church does not encourage couples to marry just because they have a child together. Getting hitched for the sake of the child has disaster written all over it. What a responsibility to put on the poor child. What happens to the marriage if the child dies? Does the marriage die with it? If so, was it ever even a real marriage?
Marriage should be between two persons who love one another and love God, who want to enter into a sacramental covenant with one another for the purpose of getting one another to heaven, raising children to get to heaven, and witnessing to the community at large the Love of God.