It does not seem the couple was refused marriage on the grounds of cohabitation itself --but on the grounds that the woman did not believe her cohabitation was a sin–therefore there was no need for her to go to confession.
All adults, even bad Catholics, have the
right to marry, if there are no impediments preventing the marriage…that is, issues that would prevent an actual marriage from taking place at all.
All Catholics, even bad Catholics–and by this I’m not reading their hearts, but only externals of observance such as could be used to measure this–are morally bound to marry in the Church, and in accordance with canon law. Therefore, the Church cannot deny the Sacrament of Marriage to Catholics on the grounds that their observance is not up to snuff, provided that the Catholics are observing laws that pertain particularly to marriage. All of these laws are laws that ensure that the marriage will be valid, since it cannot be ensured that parties to a marriage will be free of serious sin.
Therefore, all Catholics have the right to marry in the Church, so long as they are entering into a marriage that cannot be fairly presumed to be invalid from the outset. Even in that case, they apparently have the right to challenge that presumption before a marriage tribunal.
This is not to say that they do not commit sacrilege by asserting this right when they are not in a state of grace. It is to say that approaching the sacrament is a right they may assert, and judging whether they do so sacrilegiously is a decision for them to make. The priest or deacon asked to witness their marriage may not discern that for them. If they are to be rescued from that sacrilege, they must be persuaded to refrain, by their own free will, from exercising their right to marry until they may do so from a state of grace. The duty of the clergy who witness marriages, then, is to confirm that the marriage will be valid, not that it will be free of serious sin that is not also an impediment to a valid marriage.
For instance, if one of the parties to the marriage have admitted that they have never been and have no intention to remain continent with regards to sex
outside the union, or if the couple freely admits that they have no intention to welcome children, that is a different story. A total lack of intention to maintain fidelity or to be open to children would be impediments to a valid marriage, and could be a legitimate reason to deny access to the sacrament.
Otherwise, though, you are as free to marry someone who only commits fornication with you as you are to marry someone with whom you rob banks, provided the sexual sin or your history of robbing banks together do not serve as coercive factors in your consent. It doesn’t affect the validity of your marriage.
Ironically, though, if you were to tell a priest that you feel you are compelled to marry, and would not give consent except for the fact that you have committed fornication together or that you have a history of robbing banks together that you do not want disclosed, you might be denied the sacrament on that account, until it was confirmed that your consent was freely given. Mutual consent, free of coersion, is a requirement for a valid marriage.