Standard explanation: It’s actually a one-use magic item that can open any lock, after which its power is expended.
Real explanation: Because having to pair specific keys with specific doors would be a pain in the butt from a gameplay perspective.
Fun explanation: All of the locks in the dungeon have been devoured and replaced by tiny mimics that subsist exclusively on locking mechanisms; you’re not unlocking the door, you’re bribing it.