From the Super Mario Wiki
Koopa Zombies are a type of mutated, Bowser-like creatures which were created when humans came into contact with the garbage of Bowser and the Koopalings. Koopa Zombies show little to no intelligence, though they seem to be driven by the desire to blindly follow Bowser, whose surname, Koopa, they continually chant.
In The Adventures of Super Mario Bros. 3 episode "Recycled Koopa", after being exposed to the dumped garbage of Bowser and the Koopalings, the populace of Brooklyn began to change into Koopa Zombies, who proceeded to aimlessly wander the streets of the polluted city. It was only when Bowser himself ordered the Koopa Zombies to hunt down and attack Luigi and Mario (who had begun to regress to Koopa Zombie himself) that the creatures began to act, attacking Mario and Luigi wherever they went.
The human populace of Brooklyn, as well as Mario, were eventually returned to their original, normal forms when Luigi cleaned up all of Bowser and the Koopalings' garbage.