It is a matter of safety.
The longer earth pin acts as the opening rod for the shutters on the socket, and connects to earth before either the live or neutral pins connect. This way, if there is a fault with the equipment being plugged in, with the earth already connected, the fuse or circuit breaker would blow, preventing injury to the person holding the plug. Also, should the plug get knocked or accidentally pulled out when the power is on, the first pins to disconnect are the power pins, followed by the earth pin which also closes the shutters on the socket.