Why does the overflow pipe on a water heater open to the floor?
A- This is not an "overflow" pipe. 

B- It is not connected to an "overflow" valve.

C- It is a drain pipe connected to a Temperature &amp; Pressure Relief Valve which is not only a legal requirement, but a critical safety device to prevent an over-pressure event (boiler explosion- google it)

For years and years, it was common to see no pipe at all. The pipe is a great idea whether or not it is plumbed to a drain or alternative location because if the valve activates it is less of a hazard to humans when scalding steam and water are directed downward and away from hapless victims. Some (if not all) localities require that they be plumbed to the exterior of the building or to a floor drain if the appliance is located in the home. Appliances outside of the home (as yours appears to be) may not be subject to the same requirement. Check with your local building code authority office.

P.S.- there should not be water coming from that drain pipe. If there is you may have a defective TP Valve (or worse, a malfunctioning boiler). Call a plumber.