The reason for the wait is that the Church wants to make as sure as possible that the couple is marrying for the right reasons. Marriage is a life-long commitment. Pregnancies can happen to a couple who does intend a permanent, life long relations ship.
However, it is reality that all too often, people who have engaged in intercourse prior to marriage are in a situation in which one party may be far more committed to the other person, than that other person is. That is, one of them (or both) may be far more interested in the sexual aspect of the relationship than any other aspect of it. And all too often it is the male who is simply drifting along, enjoying the sex but making no commitment of any significance.
And then, “Oops” happens, and now we have a mother who wants to keep her child, but a father who is not interested in or committed to being a father and a husband. And if they decide to get married, there is a very real possibility tht one, or both of them might be seeing marriage as a way to legitimize the child, but not a lot more. And again, too often, these marriages end up in divorce.
It is not that the couple - or either of them - is trying to make a mockery of marriage; but rather that the circumstances too often are indicative of a serious lack of commitment to what marriage is supposed to be. And lacking that commitment is a fairly good indicator that the marriage may not be built on a firm foundation, and therefore at higher risk of divorce.
So, yes, they can get married, but the Church needs to guide them and to help them discern why they want to marry, and that takes time.