It has to do with the pressure and the density or "compactness" of the two phases in question.
Normally, molecules are farther apart in the liquid phase than they are in the solid phase. So if you start at a certain temperature below the solid/liquid line in the liquid phase for a normal compound and go up on the graph (raise the pressure) while remaining at the same temperature you will go from the liquid to the solid because the increase in pressure can be relieved by bringing the molecules closer together in the more compact solid phase. But for water the more compact phase is the liquid phase, not the solid phase. So if you start under the line and raise the pressure for water, the added pressure can be relieved by converting the less dense solid ice to the more compact liquid water.
The same logic applies in both cases, the order is just reversed because the density differences between the two phases are reversed.