This is due to [surface tension](http://en.wikipedia.org/wiki/Surface_tension). Water wants to stick to hard surfaces as this is a lower energy arrangement. Component of gravity perpendicular to glass pulls water away from glass wall, and surface tension pulls water to glass wall. When the angle between glass wall and vertical direction is small, component of gravity perpendicular to glass wall is small and surface tension prevails.
Latest Answers