Ohh, I see! At my gym, locker keys are given to you by the front desk and you put in something as deposit (such as your gym card or whatever you wish) and on your way out you give the key and you get your deposit back.
But why? Seems like it would be inconvenient to gym-users to add these extra steps to getting in and out of the gym. Especially if you have to wait behind other people just to get or return a key. What is the benefit of such a system?
In the case of my new gym (see my earlier reply above), far as I can tell, they are just saving money on modernization. There are similar other penny-pinching measures there, such as treadmills which apparently offer TV and Netflix, etc., but have no channels, no connectivity and no ability to cast over Bluetooth from your phone.
I asked them about the latter issue, and they said that it might get fixed next year; but there are years-old Google Reviews of the gym citing this promise!
It's a relatively small gym so I assume they don't have the resources to improve the system and quite frankly I too would prefer if they spent the money on more equipment