Then what is the purpose of this decree in canon law?
If there is a defect in the form then it is invalid. If it says that we have to follow the civil law then why is that not invalid?
The purpose of the law is exactly what you’ve already illustrated.
First, the Church does not perform marriages which cannot be recognized by civil law. This is a matter of respecting the civil authority and the state’s ability to legislate marriage. In practical terms, the couple must present a marriage license issued by the state before the wedding occurs.
Civil law requires a marriage license. If a priest were to go around officiating at marriages without that civil license, it would cause no end of problems. It would pit the Church against the state. We would become outlaws (in a sense). In most (I’m almost certain “all”) states, officiating at a marriage without the proper licenses is a felony. Some states require the officiant to have a license, as well as each couple. If we were to go around performing marriage without proper licenses, we would be in all kinds of trouble both criminally and civilly. We would have a lot of priests in jail and a lot of lawsuits against the Church.
However, at the same time, the Church does recognize that there can be times when the civil law is either unjust broadly (like prohibiting inter-racial marriages) or has an unjust effect in a particular situation (such as a couple who really should be able to marry, but who cannot merely because of some legal obstacle in their particular situation). In that case, the Church allows an exception to the rule.
Therefore, to get back to your original question, the Church made exceptions to the rule and allowed inter-racial couples to marry. Such marriages are/were perfectly valid.
The canon you cited first sets out the rule (no marriages unless the state recognize it), then the possibility of an exception.