A characterization of bielliptic curves and applications to their moduli spaces