There are a few things that could be causing your glove compartment to not close properly. One possibility is that the alignment of the hinges is off, causing the door to not line up with the opening correctly. Another possibility is that the latch itself is damaged or broken and needs to be replaced.
If the issue is with the hinges, you can try adjusting them yourself to see if that fixes the problem. If the latch is damaged, you will need to replace it with a new one.