Hugo Bartels, Standesbeamter