sanctimoniously, hypocritically, self-righteously, priggishly
Он вспомнил учителя, ханжившего перед классом.
He remembered the teacher who had acted sanctimoniously in front of the class.