It comes from surface tension. The phenomenon you see in a straw is known as 'capillary action'.
For a thin tube with water, the height of rise is given by $\frac{2T}{r\rho g}$, $r$ is radius of the tube, $T$ is the water-air surface tension constant, and $\rho$ is density of water. This can be easily derived from the fact that pressure difference across a curved surface is $2T/r$ and for water, the radius of curvature of the surface ($r$) just happens to be the same as the radius of tube for small radii.
For a glass, this equation no longer applies, as the meniscus (the curve in the water surface while in a tube) is no longer hemispherical. Neither can we use the alternate derivation normally as different sections of water behave diffently. So, we have nearly no extra pressure decrease due to surface tension. One can look at it as $R$ becoming large in the above equation, which works qualitatively, but not quantitatively. Actually, that formula isn't too accurate for even a straw. It works well when the radius of tube is in millimeters.
As for why the water stays inside a glass till you remove it is because a near-vacuum will be formed otherwise. Vacuum formation is perfectly OK, but the vacuum exerts a greater force on the water than gravity, keeping it up. With a tube of mercury one can actually see a vacuum form due to its large density. With water the vacuum is negligible or nonexistent unless the column is pretty tall. We can look at this from pressures as well. The pressure above the inside water should be 0 (due to the vacuum). But, the pressure at normal water level is atmospheric pressure. So the inside water must rise a height given by $h\rho g=p_0$. If the glass isn't tall enough, then there will be absolutely no vacuum formed (if the water tries to go down, a vacuum will be formed, and it will go up again).