Because visitors to workplaces may cause workplace health and safety issues, they may need to be generally taken into account to properly address their own safety as well as the safety as others.
Depending on the circumstances, it may be important to know what visitors are on the premises and where they are, in order to ensure their health and safety is not put at risk, or to account for them in an emergency.
There may also be security-related reasons for keeping track of visitors.