Why Weyl invariance is important for consistent string theory? This post is related to this link. I know there is a Weyl invariance for the Polyakov action at least in classical level. My question arises from obtaining effective action in string theory, such as section 7.3 in this lecture note

A consistent background of string theory must preserve Weyl invariance, which now
  requires $\beta_{\mu\nu}(G)=\beta_{\mu\nu}(B)=\beta(\Phi)=0 $

later the lecture note tried to find effective action by requiring vanishing beta function.
Also in p110 in Polchinski's string theory vol I, 

We have emphasized that Weyl invariance is essential to the consistency of string theory.

Why Weyl invariance is so important for consistency of string theory?
 A: In the answer below I will only try to motivate why Weyl+diff invariance is (thought to be) necessary in (bosonic) string theory. 
Consider a (classical) string in a spacetime with coordinates $X^\mu$ and metric $G_{\mu\nu}$. As the string moves it defines a two dimensional surface $S$. Let $g$ denote the metric induced on the surface from the spacetime metric $G$. Area of the surface measured wrt the metric $g$ serves as the (Nambu Goto) action of classical string. Parametrizing the surface with some coordinates $\sigma_1,\sigma_2$ we can write $g$ as
$g_{\alpha\beta}=\partial_{\alpha}X^\mu \partial_{\beta}X^{\nu}G_{\mu\nu}$ 
and the action can be written as 
$S_{NG}=-T\int d\sigma_1 d\sigma_2 \sqrt {-det(g)}$
For defining this action we needed to choose coordinates (more precisely local coordinate charts) on the surface $S$. It is clear that the action (~ area of the surface) is independent of the choice of the coordinates $\sigma_1,\sigma_2$ on $S$. Choice of coordinates on $S$ only serves as an auxiliary tool for describing the action conveniently rather than being a physical property of the surface. So if we quantize our string we would not want any physical observable in our quantum theory to depend upon the choice of coordinates. 
We can quantize above action but for convenience we introduce a different version of the action. This is done by introducing on $S$ a metric $h$. We may choose any metric we like except that it be of signature (-1,1) {where we are assuming that spacetime metric has signature (-1,1,...,1)}. It is known that the action 
$S_P=-\frac{T}{2}\int d\sigma_1d\sigma_2\sqrt{-det(h)} h^{\alpha\beta}\partial_{\alpha}X^\mu \partial_{\beta}X^{\nu}G_{\mu\nu}$
defines the same classical theory as $S_{NG}$ except for one main difference. Classical theory defined by $S_{P}$ has additional variables corresponding to the three independent components of the (symmetric) metric $h$. However we know that the physical string itself has no such degrees of freedom because we can describe its classical motion using the action $S_{NG}$ which depends only on $X^\mu$, and $G_{\mu\nu}$. Therefore if we want to get a quantum theory of string by quantizing the action $S_P$ then besides requiring that the physical observables in our quantum theory don't have any dependence on choice of coordinates we must also require that they don't depend on choice of metric $h$. In particular there should not be any physical observables corresponding to the metric degrees of freedom $h_{11},h_{12}=h_{21},h_{22}$ and so we should somehow be able to get rid of them. 
To get rid of three continuous degrees of freedom we need three continuous symmetries of the action. Diffemorphism invariance allows us to change the two worldsheet coordinates arbitrarily and hence effectively gives us with two continuous symmetries. We need one more continuous symmetry of action which is given by the Weyl invariance. In two dimensions it is known that using diffeomorphism and Weyl transformations any metric can be (locally) turned into a flat metric (this follows from the fact that one can always find local isothermal coordinates on two dimensional surfaces). So in the classical theory defined by action $S_P$ we can gauge away metric $h$ using the continuous symmetries of diffeomorphism and Weyl invariance. If we make sure that quantization process preserve these gauge symmetries then in quantum theory too they can be used to gauge away the metric degrees of freedom. Also since the action doesn't have any other continuous symmetry which can help us to get rid of $h$ so preserving Weyl+diff invariance is necesarry. 
