This is called double recovery, double compensation or over-recovery, and it is usually prohibited. The rule against double recovery is also known as the one-satisfaction rule. Courts may give effect to the rule by:
refusing to enforce a judgment under the relevant civil procedure rules to the extent that it has already been recovered from a co-defendant,
deducting damages already recovered from the amount awarded in any subsequent lawsuit, or
ordering the restitution of doubly-recovered payments under the doctrine of unjust enrichment.
The rule is an ancient principle of equity which developed over many centuries. The precise way in which the rule will be applied today depends on the jurisdiction and the nature of the claim. I'll outline two 18th century cases which establish the basic principle. For further information, consult a civil procedure textbook in your jurisdiction.
Two early cases establishing the unjustness of double recovery
In Moses v Macferlan (1760) 2 Burrow 1005, Moses and Macferlan settled a debt of £26 by agreeing that Moses would pay Macferlan £20 and indorse over four promissory notes to the value of 30s each (£6 total). Macferlan agreed to release Moses from liability as an indorser, but when Macferlan failed to recover the value of the notes from the issuer, he sued Moses in the Court of Conscience. Because that court's jurisdiction was limited to debts of up to 40s, it could not consider the terms of the £26 settlement and held Moses liable. Moses paid the £6, but successfully recovered it in the Court of King's Bench. Lord Mansfield said (at 1009):
Money may be recovered by a right and legal judgment; and yet the iniquity of keeping that money may be manifest, upon grounds which could not be used by way of defence against the judgment.
In Bird v Randall (1762) 3 Burrow 1345, a journeyman (Burford) contracted to work for a silk dresser (Bird) for five years. After just over a year, Burford left. Bird sued and obtained a judgment against Burford. Bird then sued Randall for 'enticing and seducing' Burford out of his service. After the case against Randall was commenced, but before it went to trial, Burford paid the first judgment. Randall then argued that Bird's action could not be maintained. Lord Mansfield said (at 1353):
[T]he plaintiff must recover upon the justice and conscience of his case, and upon that only ... the penalty recovered by him from the servant was actually received by him before the present action came on to be tried; without any sort of difficulty ... [this] is against conscience ... If he had actually recovered it, through the defendant's not knowing "that the penalty had been paid," an action would lie against him, for money had and received: like the case out of the court of conscience, not long since determined in this court [Moses v Macferlan].
The double recovery rule in the modern United States
In the scenario posed in the question, any attempt at double recovery is likely to be rejected without the need for detailed legal argument. Such a straightforward case would probably be settled without litigation, on terms providing for the debt to be apportioned between the joint debtors. But assuming that this doesn't happen, in a federal case, rule 60(b)(5) of the Federal Rules of Civil Procedure would apply:
On motion and just terms, the court may relieve a party or its legal representative from a final judgment, order, or proceeding for the following reasons ... the judgment has been satisfied, released, or discharged[.]
Different rules and procedures apply in the various State jurisdictions, but the underlying principles are generally similar. The theoretical and historical basis of the rule against double recovery, as an aspect of the law of restitution and unjust enrichment, continues to attract a great deal of academic and judicial attention in Commonwealth countries, although it seems to be of less interest to American lawyers: Saiman, 'Restitution in America: Why the US Refuses to Join the Global Restitution Party' (2008) 28(1) Oxford Journal of Legal Studies 99–126.