Door keys are used in conjunction with a Key Lock for letting others access (open and close) your door.
Important: the person who places a Key Lock, has access by default, without the need for a door key.
If the key is lost, then the person carrying it won't have access anymore. In addition, if their killer or anyone else loots it from them and are able to locate the base, your base (or the particular door) might be compromised. So overall, carrying door keys outside of your base is risky.
To avoid this risk, it's advised to upgrade to Code Locks if you have multiple people that need to have access to your doors. Using keylocks within groups is really not practical, they are mostly used by solo players.