You'll have to troubleshoot it to find out why.
Unplug the sending unit and turn the ignition to "on". Does the gauge stay on "E" or does it still swing over to full? If it goes to full then either there's a problem in the wiring or the gauge is bad. If it now stays on "E" then probably a bad sending unit.