Because hot water rises, like hot air.
If you have the heater vertically, the hot water rising up from the heating element makes the thermostat work much harder than it should, and can cause cold spots in the rest of the tank (as the thermostat 'thinks' the tank is warm enough when it's not).