The very basic reason is for safety of you and the equipment.
Imagine an electricity system, the generator or power station might be miles from where you are, and the power from that comes along the live power line, into the equipment and returns back again through the neutral power line (in simple terms). However the generator or power station is connected to earth (the physical big ball of mud and water thing we stand on), the earth is chosen because that is at the same voltage for all generators, if all the generators have the same voltage as a base level then all the 240V outputs from them will be the same (if one had a base voltage of say 50V and then generated 240 extra volts on top of this, and another had a base voltage of 0V and generated 240V on top then the second sees the first as putting out 290V – too much for it and you get problems).
The earth is a good base level for 0V, same for all generators and so they can all be joined together into a national grid system. Because of how big the earth actually is the resistance of it means that this works and electricity will return to the generator through it is the neutral wire is removed and the power wire is shoved into the earth.
Now imagine there is a problem with the electrical system and the case of a piece of electrical equipment touches the live wire, the case is now live too. Without an earth the case would stay live until something touches it (you?) and completes the circuit (generator – live wire – case – you – earth – generator), the electricity will flow though the whatever touches the case to get to earth and back to the generator. This thing might be you!
Now to make it safe you can earth the casing so now you have generator – live wire – case – earth wire – earth – generator and assuming earth wire has less resistance than you all the electricity will flow through that. Chances are if this happens the circuit breaker will trip or fuse will blow and make it safer.