The key to the curfew is an active guard presence. When you're a guard and you see someone in the city at night, you don't have to search for a reason to single them out and use your power over them. They are in the wrong. They've been caught. They're yours. In many cases, they are also the bold ones up to no good, so it's a good way of running into troublemakers. My guard encountered quite a few hostiles that turned into battles.
A key locked gate simply replaces roleplaying. It takes the emphasis from guards doing their job and says "hey gate, do this all for me you're even better at it. Hell, you're physically impossible to bypass do to game mechanics!"
That's always a bad direction to go in, in my opinion.