Bacteria frequently exhibit cooperative behaviors but cooperative strains are vulnerable to invasion by cheater strains that reap the benefits of cooperation but do not perform the cooperative behavior themselves. Bacterial genomes often contain mobile genetic elements such as plasmids. When a gene for cooperative behavior exists on a plasmid, cheaters can be forced to cooperate by infection with this plasmid, rescuing cooperation in a population in which mutation or migration has allowed cheaters to arise. Here we introduce a second plasmid that does not code for cooperation and show that the social dilemma repeats itself at the plasmid level in both within-patch and metapopulation scenarios, and under various scenarios of plasmid incompatibility. Our results suggest that although plasmid carriage of cooperative genes can provide a transient defense against defection in structured environments, plasmid and chromosomal defection remain the only stable strategies in an unstructured environment. We discuss our results in the light of recent bioinformatic evidence that cooperative genes are overrepresented on mobile elements.