The term is of historical origin; once upon a time, locks weren't quite as standardized as they are now, and there was often only one, or at most very FEW keys to any given lock. In somewhere like a castle, this could be quite significant; no key means breaking down a door if the person behind it won't come out, dies, or just won't open the door. And he who holds the key has free access to the rooms.
Usually one person was the 'Keeper of the Keys'; this was often the chief of the palace guard, or the senechal. In France, the term 'concierge' was used for the keeper of the keys. There remains an association to this day called 'Les Clefs d'Or'; concierges of 37 countries, who may be distinguished by the Gold Keys they display on their lapels, in honor of the traditional early title.
Regardless, the Keeper of the Keys is a position of trust and respect; he's the guy who can get into your room when you aren't there.. or your wife's,.... or (the list goes on..) which is why the position was given to Hagrid; Dumbledore wanted to express his trust of him, and that was a simple, but visible way to do so.
On a related note, the same term is often used for the Warden in a prison; the person who has all the keys, and can open, or seal, all locks. Again, the person who is most trusted.
Now, ignoring the historical origin for a moment, the Harry Potter Wiki says:
The Keeper of Keys and Grounds (also known as the gamekeeper or groundskeeper) is a wizard employed by Hogwarts School of Witchcraft and Wizardry to tend to and look after the grounds of the school, as well as the security of Hogwarts Castle.