The BeF2 molecule is linear and non-polar. Bonds are polar, but equivalent force acting on Be with 180o angle is zero. So, the molecule is non-polar.
The molecular geometry of H2O is bent with asymmetric charge distribution about the central oxygen atom. Therefore, this molecule is polar.