This code looks really familiar.
The point of /respawnallplayers is actually for testing purposes. In the event you modify something that hinges on the player object, or people are running around with items they shouldn't have that they got from an exploit, this function remedies that.