SIMPLIFIED AND UPDATED BASED ON ADDITIONAL INFORMATION IN THE QUESTION:
The marriage is valid, but their marriage will not allow the girlfriend to refuse to testify as a witness in the case.
She can be compelled to testify against him under oath, but does not have to testify about the confidential communications that they have with each other after they get married (e.g. if he confesses to her while there are having a private conversation after they are married, while he is outside the jail, while he is meeting with his lawyer).
All of her recorded statements made at any time, and everything that happens before they are married are available to be used as evidence at trial (assuming no other rule of evidence excludes it).
Only confidential statements made between the wife and the criminal defendant while they are married can be excluded based upon their spousal status.
This question is about the marital privilege, which is created by statute or case law. There are actually two separate marital privileges that are analyzed separately.
Also, I'm simplifying this answer to limit it to the "criminal case with a jury trial" situation. The rules are more complicated when it is not a criminal case, and in a bench trial as opposed to a jury trial, all references to the jury would instead be to the judge. But, almost everyone facing murder charges chooses a trial by jury instead of a bench trial, as is their right.
The Husband-Wife Confidential Communications Privilege
The stronger marital privilege applies to confidential communications made to a defendant's spouse during the marriage, which the defendant can insist not be presented to the jury. It doesn't matter if the spouse is still married to the defendant at the time of trial. The main exception to this privilege is for crimes committed against the spouse who is testifying, or to a crime committed against a child of either spouse.
This privilege does not apply to anything that the defendant says to the girlfriend prior to getting married and does not apply to statements made by the defendant to the spouse when other people were present, and is similar to the attorney-client privilege or the parishioner-clergy privilege. In Florida this privilege, created by statute, reads as follows:
Florida Evidence Code Section 90.504 Husband-wife privilege.—
(1) A spouse has a privilege during and after the marital relationship
to refuse to disclose, and to prevent another from disclosing,
communications which were intended to be made in confidence between
the spouses while they were husband and wife.
(2) The privilege may be claimed by either spouse or by the guardian
or conservator of a spouse. The authority of a spouse, or guardian or
conservator of a spouse, to claim the privilege is presumed in the
absence of contrary evidence.
(3) There is no privilege under this section:
(a) In a proceeding brought by or on behalf of one spouse against the
(b) In a criminal proceeding in which one spouse is charged with a
crime committed at any time against the person or property of the
other spouse, or the person or property of a child of either.
(c) In a criminal proceeding in which the communication is offered in
evidence by a defendant-spouse who is one of the spouses between whom
the communication was made.
In many states (and in federal court), this Husband-Wife privilege for confidential communications has an exception for cases where the husband and wife jointly carry out a crime or fraud. But, Florida does not have this exception to the Husband-Wife privilege for confidential communications in state court criminal cases.
In federal criminal cases, the case law under Federal Rule of Evidence 501 creates a substantially similar privilege for the purposes of this question. Federal Rule of Evidence 501 is as follows:
The common law — as interpreted by United States courts in the light
of reason and experience — governs a claim of privilege unless any of
the following provides otherwise:
the United States Constitution;
a federal statute; or
rules prescribed by the Supreme Court.
But in a civil case, state law governs privilege regarding a claim or
defense for which state law supplies the rule of decision.
Since this is a criminal case, the last sentence of Federal Rule of Evidence 501 does not apply. There are also not any rules regarding this topic that have actually been prescribed by the U.S. Supreme Court. And, neither the U.S. Constitution nor any federal statute creates a husband-wife or spousal testimonial privilege.
So, this issue is governed in federal court by "The common law — as interpreted by United States courts in the light of reason and experience." The relevant common law rules apply nationwide, although different federal court of appeals circuits may apply them slightly differently when the U.S. Supreme Court hasn't supplied a clear rule.
The Spousal Testimonial Privilege
The weaker marital privilege (sometimes called the spousal testimonial privilege) in many states, which is similar to the 5th Amendment right of a criminal defendant not to testify at trial, is a criminal defendant's right to prevent his current wife (but not a former spouse) from testifying against him at trial on any matter whatsoever, regardless of whether it relates to something that happened during the marriage or not. This marital privilege often has many exceptions for serious crimes and domestic violence in jurisdictions where it applies.
In the federal courts, however (pursuant to case law developed under Federal Rule of Evidence 501), this weaker privilege belongs to the spouse called as a witness rather than to the criminal defendant. The spouse of a criminal defendant isn't required to testify against a current spouse in federal criminal prosecutions, but the spouse and not the criminal defendant gets to decide if the spouse will refuse to testify.
There may be exceptions to the federal spousal testimonial privilege in cases where one spouse is accuses of a crime against the spouse or a child of one of the spouses, where they are joint participants in a crime, or where the competency of the criminal defendant is at issue (see Wikipedia). The only exceptions which might plausibly apply in a federal criminal trial are if the criminal defendant is the father of your son, or if the criminal defendant and his girlfriend whom he marries were joint participants in the crime, neither of which seems likely to be the case here.
In Florida, the weaker marital privilege also known as the spousal testimonial privilege cannot be asserted in state court criminal prosecutions but may be asserted in federal court criminal prosecutions. (See, e.g., here).