Starting in Gen VI, Cotton Spore affects all adjacent foes, but not allies. From Gens III to IV, it would only target one foe or ally in Double Battles.
Cotton Spore (Bulbapedia)
"In Double and Triple Battles, Cotton Spore now targets all adjacent foes." Bulbapedia basically they affect your enemies and not the Pokemon you are battling with