This prevents accidentally leaving the padlock unlocked, and it also prevents accidentally locking the key inside a locker, shed, etc.
This ensures that the padlock is not left unlocked by mistake, and it also guards against the key being locked inside a locker, shed, or other enclosed space.